Commit Graph

2512 Commits

Author SHA1 Message Date
Raimonds Simanovskis
9e23835cb8 fix for test_read_attributes_before_type_cast_on_datetime - Oracle adapter also returns Time value 2011-02-02 09:06:42 -08:00
Franck Verrot
a5b03e9c7a Implement and test private method all_timestamp_attributes_in_model
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-02-02 12:45:14 -02:00
Franck Verrot
47315760bc Test timestamp_attributes_for_update_in_model that was already in place
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-02-02 12:45:03 -02:00
Franck Verrot
5178e64175 Added timestamp_attributes_for_create_in_model
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-02-02 12:44:53 -02:00
Franck Verrot
598b32c581 Test private method all_timestamp_attributes
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-02-02 12:44:41 -02:00
Franck Verrot
253f5a15f4 Test private method timestamp_attributes_for_update
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-02-02 12:44:25 -02:00
Franck Verrot
6d40d527e8 Test private method timestamp_attributes_for_create
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-02-02 12:44:05 -02:00
Aaron Patterson
5b42e96602 make sure de-serialization happens on object instantiation 2011-02-01 15:23:55 -08:00
Aaron Patterson
a0fac71922 store the serialized column values in the @attributes hash 2011-02-01 14:25:47 -08:00
Aaron Patterson
ebe485fd8e serialize can take an arbitrary code object 2011-02-01 14:25:47 -08:00
Aaron Patterson
ee34b4cf34 share column cache among subclasses, only look up columns per AR::Base subclass once 2011-02-01 14:25:46 -08:00
Aaron Patterson
3cc2b77dc1 adding a YAML Column coder for YAML serialization to db columns 2011-02-01 14:25:46 -08:00
Aaron Patterson
65f11ff789 column will use coder to typecase value when it is available 2011-02-01 14:25:46 -08:00
Aaron Patterson
a7c2f6be30 coders can be assigned to columns 2011-02-01 14:25:46 -08:00
Aaron Patterson
6d5e3b86d5 namespace test so we can dry up constant lookup 2011-02-01 14:25:46 -08:00
Glenn Vanderburg
6bd9fac1e3 Propagate association extensions to scopes called on the association.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-02-01 12:38:58 -02:00
Akira Matsuda
817e370136 Make before_type_cast available for datetime fields
[#3973 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-02-01 12:21:18 -02:00
Pratik Naik
9666b6a625 Run BulkAlterTableMigrationsTest only when the adapter supports them 2011-01-31 14:10:51 +00:00
Pratik Naik
30176f28a4 Add :bulk => true option to change_table 2011-01-31 13:21:25 +00:00
Jon Leighton
3fa61ccb9e Has many through - It is not necessary to manually merge in the conditions hash for the through record, because the creation is done directly on the through association, which will already handle setting the conditions. 2011-01-30 11:58:09 +00:00
Jon Leighton
2e24cf7cc2 AssociationCollection#clear can basically just use #delete_all, except it should return self. 2011-01-30 11:58:08 +00:00
Jon Leighton
88df88095c AssociationCollection#to_ary should definitely dup the target! Also changed #replace which was previously incorrect, but the test passed due to the fact that to_a was not duping. 2011-01-30 11:58:08 +00:00
Jon Leighton
b7bcc7e190 DRY up first/last and hence make last benefit from the bugfix in first 2011-01-30 11:58:08 +00:00
Jon Leighton
63c73dd021 We shouldn't be using scoped.scoping { ... } to build associated records, as this can affect validations/callbacks/etc inside the record itself [#6252 state:resolved] 2011-01-30 11:56:41 +00:00
Alexey Nayden
fa779c5357 Fixing incorrectly writtent testcase 2011-01-28 15:06:02 -08:00
Alexey Nayden
2884482c34 test_first_and_array_index_zero_methods_return_the_same_value_when_nested_attributes_are_set_to_update_existing_record added 2011-01-28 15:06:01 -08:00
Aaron Patterson
e6881217ed fixing bug where 1.8 hangs while running pg tests 2011-01-18 10:49:50 -08:00
Aaron Patterson
fdfabc99e8 fixing unused variable warnings 2011-01-17 14:22:17 -08:00
Jon Leighton
d1521719c5 Removed support for accessing attributes on a has_and_belongs_to_many join table. This has been documented as deprecated behaviour since April 2006. Please use has_many :through instead. A deprecation warning will be added to the 3-0-stable branch for the 3.0.4 release. 2011-01-16 13:43:54 -08:00
Jon Leighton
bf24fe810c belongs_to records should be initialized within the association scope 2011-01-16 13:43:53 -08:00
Jon Leighton
52c47556b7 Add create_association! for belongs_to 2011-01-16 13:43:53 -08:00
Aaron Patterson
2947197421 use rake to create test databases for us 2011-01-14 14:07:16 -08:00
Aaron Patterson
f30a3106f3 transactional fixtures must be set to false for this test 2011-01-14 13:45:30 -08:00
Aaron Patterson
1e9685f159 preheat the table cache in arel 2011-01-14 11:16:31 -08:00
Santiago Pastorino
3755ae04a1 Add missing require 2011-01-14 17:11:15 -02:00
Aaron Patterson
3165dca28c include_in_memory? should check against @target list in case of new records. [#6257 state:resolved] 2011-01-12 18:07:53 -08:00
Aaron Patterson
f8700038af adding a test for no method error 2011-01-11 17:57:02 -08:00
Aaron Patterson
fcd8925f23 use underlying _read_attribute method rather than causing NoMethodErrors 2011-01-11 15:39:26 -08:00
Jon Leighton
552df9b933 Support for create_association! for has_one associations 2011-01-11 13:45:09 -08:00
Jon Leighton
681ab53ba1 Get rid of set_association_target and association_loaded? as the parts of the code that need that can now just use association_proxy(:name).loaded?/target= 2011-01-11 13:45:08 -08:00
Jon Leighton
3b797c8c86 DRY up the code which instantiates the association proxy 2011-01-11 13:45:08 -08:00
Jon Leighton
6055bbedaa Raise ActiveRecord::RecordNotSaved if an AssociationCollection fails to be replaced 2011-01-11 13:45:07 -08:00
Jon Leighton
1d6e218428 When assigning a has_one, if anything fails, the assignment should be rolled back entirely 2011-01-11 13:45:07 -08:00
Jon Leighton
4e19ec566c In a number of places in the tests, we only need to turn off transactional fixtures when the DB does not support savepoints. This speeds the test run up by about 8-9% on my computer, when running rake test_sqlite3_mem :) 2011-01-11 13:45:07 -08:00
Jon Leighton
7f7b480098 When assigning a has_one, if the new record fails to save, raise an error 2011-01-11 13:45:07 -08:00
Jon Leighton
1bc71ed960 When assigning a has_one, if the existing record fails to be removed from the association, raise an error 2011-01-11 13:45:06 -08:00
Jon Leighton
c47c541402 Have a separate test connection directory for sqlite3 in-memory so that the tests can be run without having to specifically rename the connection file (which then causes git to pick up the changes) 2011-01-11 13:45:06 -08:00
Jon Leighton
80df74bf51 Enable the sqlite3 in-memory test connection to work 2011-01-11 13:45:06 -08:00
Jon Leighton
c6e10b0f60 has_one should always remove the old record (properly), even if not saving the new record, so we don't get the database into a pickle 2011-01-11 13:45:06 -08:00
Ernie Miller
7d4d745730 Fix polymorphic belongs_to associationproxy raising errors when loading target. 2011-01-11 09:19:19 -08:00