Jon Leighton
50d395f96e
Raise error when using write_attribute with a non-existent attribute.
...
Previously we would just silently write the attribute. This can lead to
subtle bugs (for example, see the change in AutosaveAssociation where a
through association would wrongly gain an attribute.
Also, ensuring that we never gain any new attributes after
initialization will allow me to reduce our dependence on method_missing.
2011-09-13 00:01:58 +01:00
thedarkone
10863580aa
Bring back the ability to provide :order for update_all.
2011-07-25 13:33:44 +02:00
Aaron Patterson
61774e0d49
please use ruby -I lib:test path/to/test.rb, or export RUBY_OPT
2011-06-06 15:47:13 -07:00
Jon Leighton
253bb6b926
Refactor Active Record test connection setup. Please see the RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases.
2011-06-04 23:47:03 +01:00
José Valim
9e4b715d79
Ensure assign_attributes and update_attributes do not fail on nil, closes #478 .
2011-05-10 10:30:27 +02:00
Josh Kalderimis
78e581bd2f
some test renaming to avoid collisions, and some annoying issues between dbs
2011-04-27 23:27:10 +02:00
Josh Kalderimis
e85dbd8f06
final corrections to the mass-assignment security tests
2011-04-27 20:57:56 +02:00
Josh Kalderimis
fee69cb021
fix mass-assignment security tests, this was due to a string column limit which doesn't cause issues on sqlite
2011-04-27 00:28:24 +02:00
Josh Kalderimis
bb7024b6ec
AR update_attributes api is updated to reflect the addition of assign_attributes
2011-04-26 18:00:57 +02:00
Josh Kalderimis
a08d04bedf
Added assign_attributes to Active Record which accepts a mass-assignment security scope using the :as option, while also allowing mass-assignment security to be bypassed using :with_protected
2011-04-24 09:53:18 +02:00
Aaron Patterson
6067d29a1f
oracle stores this with microseconds, so convert to seconds before comparing
2011-03-29 17:09:22 -07:00
Sebastian Martinez
245542ea29
Added new #update_column method.
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-03-27 21:47:38 -03:00
Sebastian Martinez
0e1fed537a
Revert "Removed #update_attribute method. New #update_column method."
...
This reverts commit 45c233ef81
.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-03-27 18:55:30 -03:00
Sebastian Martinez
45c233ef81
Removed #update_attribute method. New #update_column method.
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-03-26 12:09:04 -03:00
Aaron Patterson
2738ec891b
removing many unused variables
2010-11-16 17:06:50 -08:00
Franck Verrot
de2933e1a0
STI type is now updated when calling AR::Base.becomes on subclasses [ #5953 state:resolved]
2010-11-12 02:17:34 +08:00
Thiago Pradi
ececa75c66
Fixing typo [ #5485 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-08-28 17:51:22 -03:00
Santiago Pastorino
b451de0d6d
Deletes trailing whitespaces (over text files only find * -type f -exec sed 's/[ \t]*$//' -i {} \;)
2010-08-14 04:12:33 -03:00
José Valim
e4943e93c2
Make update_attribute behave as in Rails 2.3 and document the behavior intrinsic to its implementation.
2010-08-12 12:04:16 -03:00
Neeraj Singh
807239f5a1
Making Active Record base_test.rb thinner by moving tests
...
to relevant files.
Number of assertions before refactoring:
2391 tests, 7579 assertions, 0 failures, 0 errors
Number of assertions after refactoring:
2391 tests, 7579 assertions, 0 failures, 0 errors
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-08-03 10:45:54 +02:00
Subba Rao Pasupuleti
b0c7dee4f2
removing unused models from tests
...
[#5153 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-21 22:08:07 +02:00
Neeraj Singh
992711a86b
update_attribute should not update readonly attributes
...
[#5106 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-21 14:55:57 +02:00
Santiago Pastorino
79d9e0f155
Makes this test don't trust on the speed of execution
2010-07-17 02:39:26 +08:00
Neeraj Singh
1f2a5199cb
moving persistence related tests to a new file
...
Before refactoring test result from AR:
2291 tests, 7180 assertions, 0 failures, 0 errors
After the refactoring test result from AR:
2291 tests, 7180 assertions, 0 failures, 0 errors
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-16 17:26:06 +02:00