Commit Graph

2405 Commits

Author SHA1 Message Date
Piotr Sarnacki
40b15f9f38 ActiveRecord::Base.joins should allow single nil argument [#6181 state:resolved] 2010-12-16 22:25:09 +01:00
Jon Leighton
14b880fd03 Fix various issues with the :primary_key option in :through associations [#2421 state:resolved] 2010-12-15 17:50:14 -08:00
Jon Leighton
09ddca67ac Fix problem with duplicated records when a :uniq :through association is preloaded [#2447 state:resolved] 2010-12-15 17:47:42 -08:00
Pavel Gorbokon
96bae30538 Replace rudimentary named_scope with scope. [#6052 state:resolved]
* rename method names (actually in tests)
* rename instance variable @_named_scopes_cache to @_scopes_cache
* rename references in doc comments
* don't touch CHANGELOG :)
2010-12-15 14:02:30 -08:00
Franck Verrot
aa40543022 Provide test for #4840: to_xml doesn't work in such case: Event.select('title as t').to_xml 2010-12-15 14:02:30 -08:00
Pivotal Labs
15984dbe35 test for eager load of has_one association with condition on the through table 2010-12-16 01:49:30 +05:30
Jon Leighton
491ce5b6ce Verify that creating a has_many through record where there is a default_scope on the join model works correctly (creates the join record with the default scope applied) 2010-12-16 01:49:30 +05:30
Jon Leighton
eba7664086 Respect the default_scope on a join model when reading a through association 2010-12-16 01:49:30 +05:30
Ernie Miller
5d37ff6bb2 Fix hm:t to self table aliasing in construct_scope 2010-12-16 01:49:29 +05:30
Joe Hannon
7bffa9dd01 add test which fails for has_many through self join [#4361 state:open] 2010-12-16 01:49:29 +05:30
Aaron Patterson
08ccca7644 fixing whitespace errors 2010-12-16 01:49:29 +05:30
Aaron Patterson
a1ca1e85a9 persisted? should be able to return a truthy object 2010-12-16 01:49:28 +05:30
Chiel Wester
bda16eb092 Only call save on belongs_to associations if the record has changed or any nested associations have changed (resolves #3353)
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-12-16 01:49:28 +05:30
Aaron Patterson
3e7c351b48 preheating cache so that tests can run in isolation 2010-12-09 15:12:48 -08:00
Robert Pankowecki (Gavdi)
bba3dacc3d Simplifies observer implementation [#6065 state:resolved] 2010-12-09 10:41:43 -08:00
Piotr Sarnacki
6f8958277b Fix test on finding migrations from 2 paths
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-12-09 18:50:44 +01:00
José Valim
cc48192248 Merge remote branch 'drogus/dummy_tasks'
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-12-09 16:09:51 +01:00
Mike Dvorkin
f572a02b94 Take into account current time zone when serializing datetime values [#6096 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-12-09 09:01:49 +01:00
Aditya Sanghi
7a237d56aa Ensure that boolean false is properly serialized [#6079 state:resolved] 2010-12-08 15:51:47 -08:00
Jeff Dean
7ecee054a3 Setting the id of a belongs_to object updates all referenced objects [#2989 state:resolved] 2010-12-08 15:21:18 -08:00
Piotr Sarnacki
d0467e08e5 Allow to run migrations from more than one directory 2010-12-09 00:04:36 +01:00
Aaron Patterson
a299fcaef9 not a responsibility for rails to test 2010-12-03 16:22:42 -08:00
Aaron Patterson
399730bdd2 removing unused setup 2010-12-03 12:00:09 -08:00
Aaron Patterson
47737681fd in the middle of refactoring 2010-12-03 12:00:09 -08:00
Santiago Pastorino
42c51b8527 Doesn't need to sort, lets users of attribute_names sort them if they want 2010-12-02 20:28:24 -02:00
Aaron Patterson
077ec5a0ed fixing space errors 2010-12-02 08:45:37 -08:00
Aaron Patterson
da6ce2e253 adding a test for YAML round trip 2010-12-02 08:44:48 -08:00
Michael Koziarski
96eec090df Work around a strange piece of Syck behaviour where it checks Model#respond_to? before initializing the object.
Things like YAML.load(YAML.dump(@post)) won't work without this.
2010-12-02 08:40:34 -08:00
Aaron Patterson
3ec212e3c9 rolling out migrated_at until I can fix the build 2010-12-01 17:08:01 -08:00
Aaron Patterson
c15c14563e removing duplicate test 2010-12-01 15:14:56 -08:00
Aaron Patterson
85a5318c2b should not to_s the possibly nil value 2010-12-01 15:14:10 -08:00
Aaron Patterson
4232454289 make sure we have a value in migrated_at 2010-12-01 15:07:44 -08:00
Aaron Patterson
7d2179608c not all databases return dates as strings 2010-12-01 14:59:17 -08:00
Aaron Patterson
c266a6bf0f fixing tests and warnings 2010-12-01 14:33:59 -08:00
Josh Susser
a49de9811a tests mostly pass
adjust to work with instance-based migations
migrated_at can't be null
why must people have last names? it's killing me!
2010-12-01 12:01:56 -08:00
Josh Susser
b07c2c0fd3 clear schema_migrations in Schema.define 2010-12-01 11:01:15 -08:00
Josh Susser
7139aa878c name in schema_migrations, migrations in schema dump 2010-12-01 10:57:38 -08:00
Josh Susser
4e4e9ad48a record migration timestamp when migrations run 2010-12-01 10:46:29 -08:00
Josh Susser
c283cdd63c Add migrated_at column to schema_migrations table. 2010-12-01 10:46:29 -08:00
Aaron Patterson
542cb5c327 fix warnings, stop using global variables 2010-11-30 18:46:56 -08:00
Aaron Patterson
22b01c52c7 isolating eager_loading? method 2010-11-30 16:10:49 -08:00
Aaron Patterson
b293ab7c61 making sure scope_for_create value is cached 2010-11-30 15:45:32 -08:00
Aaron Patterson
b2e7d1e41e surrounding scope_for_create behavior 2010-11-30 15:44:30 -08:00
Aaron Patterson
dccf624b64 Ruby 1.8, how does it work? 2010-11-30 15:20:27 -08:00
Aaron Patterson
3ad0779e56 testing combined nodes are not traversed 2010-11-30 14:56:32 -08:00
Aaron Patterson
795dc3d15f adding more tests surrounding where_values_hash 2010-11-30 14:47:55 -08:00
Aaron Patterson
6c32290bac testing Relation#table_name 2010-11-30 14:29:35 -08:00
Aaron Patterson
bfc398cb70 adding a test for ActiveRecord::Relation 2010-11-30 14:10:55 -08:00
Aaron Patterson
b7a9890d77 fix whitespace errors 2010-11-30 13:38:48 -08:00
Aaron Patterson
76a15dd059 adding more tests surrounding where values hash 2010-11-29 16:41:02 -08:00