Commit Graph

34636 Commits

Author SHA1 Message Date
Andy Lindeman
33b3fa67c4 Revert "Make sure that RAILS_ENV is set when accessing Rails.env"
This reverts commit b3125c89f42968bec6ee0b92ab93e36dbc36d5c3.

* It is not desirable to set `ENV['RAILS_ENV']`; otherwise, it will leak
  through to rake tasks such as `rake test` or `rake spec`. See #7175
  for more details.
2012-12-21 17:22:57 -05:00
Carlos Antonio da Silva
4da76d7d4a Remove duplicated methods in command recorder and duplicated test name 2012-12-21 19:55:24 -02:00
Carlos Antonio da Silva
2976282251 Fix calling quote column name in interpolated string 2012-12-21 19:54:44 -02:00
Aaron Patterson
68e91da765 Merge pull request #8267 from marcandre/reversible_drop_table_etc
Reversible commands
2012-12-21 13:22:52 -08:00
Guillermo Iguaran
59ea907a30 Merge pull request #8584 from garysweaver/security_guide_update
Updated security guide to reference secret_key_base instead of secret_token
2012-12-21 12:50:09 -08:00
Gary S. Weaver
e176580e07 Updated security guide to reference secret_key_base instead of secret_token, with a little information about the change from CookieStore to EncryptedCookieStore. 2012-12-21 15:46:44 -05:00
Rafael Mendonça França
ecc7751575 Merge pull request #7376 from dmitriy-kiriyenko/fix-double-callback-in-same-statement
Prevent callback from being set twice.

Conflicts:
	activesupport/CHANGELOG.md
2012-12-21 17:39:03 -03:00
Rafael Mendonça França
bda1937f28 Remove CHANGELOG entry for ActiveModel::Errors#add_on_present 2012-12-21 17:10:41 -03:00
Rafael Mendonça França
ac6941fb71 Use :present as key for the absence validatior message 2012-12-21 17:10:16 -03:00
Rafael Mendonça França
b437053b5b Remove ActiveModel::Errors#add_on_present method.
We don't need to define a new method in ActiveMode::Errors for each
validatior.

See
d72a07f1d1 (commitcomment-2325333)
2012-12-21 17:06:18 -03:00
Guillermo Iguaran
8ee1c26abc Merge pull request #8581 from garysweaver/security_guide_update
Update security guide
2012-12-21 12:03:43 -08:00
Gary S. Weaver
d2b158465e Updated security guide with information about secret_token.rb and to suggest securing sensitive files like database.yml and secret_token.rb 2012-12-21 14:59:09 -05:00
Rafael Mendonça França
48b40ec6fa BufferedLogger is deprecated too. 2012-12-21 15:59:13 -03:00
Rafael Mendonça França
b37b6b728d Fix broken test for postgresql
For some reason postgresql doesn't pass an integer value to load.

cc @tenderlove
2012-12-21 15:58:43 -03:00
Marc-Andre Lafortune
a81845f268 Update Migration and 4.0 Release Guides, Changelogs [#8267] 2012-12-21 13:56:16 -05:00
Marc-Andre Lafortune
06c7ba881d Make execute, change_column and remove_columns methods actually irreversible
[#8267]
2012-12-21 13:54:53 -05:00
Marc-Andre Lafortune
e43e8e268f Make change_table reversible when possible [#8267] 2012-12-21 13:54:52 -05:00
Marc-Andre Lafortune
aedcd68368 Migration generators use change even for destructive methods [#8267] 2012-12-21 13:54:52 -05:00
Marc-Andre Lafortune
7204d3c63e Factorize methods that are easily reversible [#8267] 2012-12-21 13:54:52 -05:00
Marc-Andre Lafortune
313232463d Make remove_index reversible [#8267] 2012-12-21 13:54:52 -05:00
Marc-Andre Lafortune
e28ddea098 Differentiate between remove_column and remove_columns. Make remove_column reversible.
[#8267]
2012-12-21 13:54:52 -05:00
Marc-Andre Lafortune
af871a0623 Make drop_table reversible [#8267] 2012-12-21 13:54:52 -05:00
Marc-Andre Lafortune
bd155d2ae3 Add drop_join_table [#8267] 2012-12-21 13:54:51 -05:00
Marc-Andre Lafortune
99770e4c65 Add Migration#reversible for reversible data operations [#8267] 2012-12-21 13:54:51 -05:00
Marc-Andre Lafortune
65e154f33b Allow revert of whole migration [#8267] 2012-12-21 13:54:51 -05:00
Marc-Andre Lafortune
24653c945a Extract exec_migration [#8267] 2012-12-21 13:54:51 -05:00
Marc-Andre Lafortune
d327c1805a Allow reverting of migration commands with Migration#revert [#8267] 2012-12-21 13:54:51 -05:00
Marc-Andre Lafortune
740dbf8d42 Split ridiculously long line 2012-12-21 13:54:51 -05:00
Marc-Andre Lafortune
29ed612bd9 Simple replacement of variable name for consistency 2012-12-21 13:54:50 -05:00
Marc-Andre Lafortune
b045804c1e Simplify change_table and avoid duplicated logic 2012-12-21 13:54:50 -05:00
David Heinemeier Hansson
95f5f8167f Revert "Make sure that ActiveSupport::Logger includes the Logger extensions from core_ext/logger" (some confusion over deprecation)
This reverts commit d00f568a83a5159ed93618b1081bd17858536d1c.
2012-12-21 19:35:10 +01:00
David Heinemeier Hansson
d00f568a83 Make sure that ActiveSupport::Logger includes the Logger extensions from core_ext/logger 2012-12-21 19:28:24 +01:00
David Heinemeier Hansson
f914454f3a Add ActiveSupport::Logger#silence that works the same as the old Logger#silence extension 2012-12-21 19:15:36 +01:00
Vijay Dev
e0176bf732 Merge branch 'master' of github.com:lifo/docrails 2012-12-21 23:14:08 +05:30
Rafael Mendonça França
f2e0925ab7 Serialized attribute can be serialized in an integer column
Fix #8575
2012-12-21 14:41:13 -03:00
Vijay Dev
4a8bdabc8e copy edits in assets guide [ci skip] 2012-12-21 23:08:56 +05:30
Vijay Dev
6fee8f3ce6 Revert "Fix incorrect adjustment 4c41e87e3ae548c44810b66437b2f0f6e73b2106"
This reverts commit e1f8ec59f2cc83f052b15233147aa2d6d8114a4d.

Reason: seems bad styling

[ci skip]
2012-12-21 23:03:52 +05:30
Rafael Mendonça França
aefcd342c4 Wrap table creation in a transaction.
This will make the tests pass when the intrange datatype is not present
2012-12-21 12:48:07 -03:00
Carlos Antonio da Silva
c7d7e7f751 Fix doc pointing to non existent logger class [ci skip] 2012-12-21 09:10:29 -02:00
Carlos Antonio da Silva
9e7bcaa9b3 Fix indentation issuing warning 2012-12-20 20:19:36 -02:00
Rafael Mendonça França
4eefa1ef1d Merge pull request #8560 from u16suzu/master
Fix document for String#humanize

Conflicts:
	activesupport/lib/active_support/core_ext/string/inflections.rb
2012-12-20 18:29:49 -03:00
Rafael Mendonça França
3aa327f988 Merge pull request #8567 from frodsan/update_coding_conventions_journey
update AD::Journey to follow Rails coding conventions
2012-12-20 12:45:09 -08:00
Francesco Rodriguez
eb493f5ac8 update AD::Journey to follow Rails coding conventions 2012-12-20 15:42:39 -05:00
kei
e1f8ec59f2 Fix incorrect adjustment 4c41e87e3ae548c44810b66437b2f0f6e73b2106 2012-12-20 18:24:31 +09:00
Guillermo Iguaran
a8ad694a86 Fix CHANGELOG entry about scope change
I missed attribution on this 😳
2012-12-20 04:21:34 -05:00
kei
4c41e87e3a Fix documentation style 2012-12-20 18:10:21 +09:00
Dmitriy Kiriyenko
4a9644a0d9 Prevent callback from being set twice.
When you add one callack in two separate `set_callback` calls - it is
only called once.

When you do it in one `set_callback` call - it is called twice.

This violates the principle of least astonishment for me. Duplicating
callback is usually an error. There is a correct and obvious way to do
anything without this "feature".

If you want to do

    before_save :clear_balance, :calculate_tax, :clear_balance

or whatever, you should better do

    before_save :carefully_calculate_tax

    def carefully_calculate_tax
      clear_balance
      calculate_tax
      clear_balance
    end

And this even opens gates for some advanced refactorings, unlike the
first approach.

My assumptions are:

- Principle of least astonishment is violated, when callbacks are either
  prevented from duplication, or not.
- Duplicating callbacks is usually an error. When it is intentional -
  it's a smell of a bad design and can be approached without abusing
  this "feature".

My suggestion is: do not allow duplicating callbacks in one callback
call, like it is not allowed in separate callbacks call.
2012-12-20 11:06:45 +02:00
John Kelly
9f42f732a4 Remove Reference to Ruby 1.8.7 2012-12-20 00:24:49 -08:00
Carlos Antonio da Silva
42b555dcf3 Fix Action Mailer changelog indenation to match other changelogs
Also some minor improvements to other changelogs. [ci skip]
2012-12-19 23:09:04 -02:00
Carlos Antonio da Silva
05b80a1cce Improve AMo changelog example to not rely on AR [ci skip] 2012-12-19 23:03:32 -02:00