José Valim
7e6530b170
Merge remote branch 'eloy/master'
2010-01-09 00:23:29 +01:00
José Valim
93898b389b
Ensure new validates works with uniqueness validator.
2010-01-08 23:50:31 +01:00
Eloy Duran
7f775ef1a9
Renamed AssociationReflection #collection_association? to #collection?.
2010-01-08 21:47:17 +01:00
Eloy Duran
f2aacd5140
Rollback the transaction when one of the autosave associations fails to save. [ #3391 state:resolved]
2010-01-08 21:45:02 +01:00
Lawrence Pit
5193fe9dd7
Exclude unchanged records from the collection being considered for autosave. [ #2578 state:resolved]
...
Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com >
2010-01-08 21:45:02 +01:00
Bryan Stearns
1080351437
Add failing test that triggers the stack overflow
2010-01-08 21:45:02 +01:00
José Valim
423e2acbb7
Merge remote branch 'eloy/master'
2010-01-07 20:13:07 +01:00
José Valim
b0572ab2b6
Be sure to dup load paths before clearing the array.
2010-01-07 15:31:50 +01:00
José Valim
190ce3ab37
Errors messages are now moved from :activerecord.errors to simply :errors on I18n yml files.
2010-01-07 15:31:49 +01:00
Eloy Duran
9550916903
Raise a RecordNotFound if an ID in nested attributes is given but doesn't return a record. [ #2415 state:resolved]
2010-01-07 13:19:49 +01:00
Eloy Duran
b6264c43f4
Moved the validation logic to the association reflection and refactored autosave_association.rb a bit.
2010-01-07 13:19:48 +01:00
Eloy Duran
fc6aae3459
Remove deprecated '_delete' option from NestedAttributes.
2010-01-07 13:19:48 +01:00
Eloy Duran
f82adc7c5a
Add AssociationReflection#collection_association? which returns true if it's for a has_many or has_and_belongs_to_many association.
2010-01-07 13:19:48 +01:00
Eloy Duran
1afa9fa5a9
Refactored nested attributes a bit around :reject_if => :all_blank.
2010-01-07 13:19:48 +01:00
José Valim
0c2d933f36
Ensure before_validation and after_validation accepts :on as option.
2010-01-06 22:24:16 +01:00
Joshua Peek
e5ed62deea
Autoload AR test case
2010-01-04 16:50:01 -06:00
David Heinemeier Hansson
5e94d3e3ea
Merge
2010-01-03 22:27:28 -08:00
David Heinemeier Hansson
1459c8cc1d
Changed ActiveRecord::Base.store_full_sti_class to be true by default reflecting the previously announced Rails 3 default [DHH]
2010-01-03 19:30:28 -08:00
Pratik Naik
a68165833a
Add Relation#create_with to explictily specify create scope
2010-01-04 03:50:16 +05:30
Pratik Naik
a115b5d79a
Ensure using proper engine for Arel::Table
2010-01-04 02:05:18 +05:30
Pratik Naik
00f3f6dc31
Relation#merge and Relation#except should respect locks
2010-01-03 21:25:19 +05:30
Pratik Naik
af5e1b4cc6
Add Relation#except
2010-01-03 19:43:29 +05:30
Pratik Naik
3eca0ab838
Give preference to the second relation's order when merging
2010-01-03 18:52:30 +05:30
Pratik Naik
6f5f23aaa7
Add Relation#includes to be an equivalent of current finder option :include
2010-01-03 03:24:28 +05:30
José Valim
5fdd0e80a4
Be sure to convert namespaced names to we have 'Parrots name' instead of 'Parrots.name' in error messages.
2010-01-02 22:27:02 +01:00
José Valim
dcafe995bf
Make nested attributes behave like in 2.3.5 and add a sanity test for it with I18n.
2010-01-02 22:27:02 +01:00
Pratik Naik
ac1df91e5e
Implement Relation#create and Relation#create!
2010-01-03 00:16:14 +05:30
Pratik Naik
65200d2933
Implement Relation#new
2010-01-03 00:08:59 +05:30
Pratik Naik
3e6e3e90ef
Remove the test which was testing a non-existing method, always failing on 1.9 and never even running on 1.8
2010-01-02 16:12:01 +05:30
José Valim
8c5fe60ec8
Simplify repair_validations on AR and make it work with new callbacks.
2010-01-01 03:20:38 +01:00
Pratik Naik
8734f9a271
Relation#many? shoud load the records if there's a LIMIT
2009-12-30 12:14:00 +05:30
Pratik Naik
bdf59a5618
Add Relation#any? and Relation#many?
2009-12-30 12:11:22 +05:30
Pratik Naik
a56518aee2
Fix the count test for postgres
2009-12-30 10:41:47 +05:30
Emilio Tagua
00cd3789f6
Relation#count should look for projections in chained relations and perform the count on the given column
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2009-12-30 01:12:38 +05:30
Pratik Naik
981f696398
Relation#respond_to? should take second argument for responding to private methods
2009-12-29 12:31:08 +05:30
Pratik Naik
bc933d0fa1
Make sure Relation responds to dynamic finder methods
2009-12-29 12:27:40 +05:30
Pratik Naik
f290e685f0
Add Relation#size and Relation#empty?
2009-12-29 12:15:28 +05:30
Pratik Naik
54b80c7361
Add Relation#delete_all
2009-12-29 11:46:07 +05:30
Pratik Naik
078ea0dfbd
Oops. Remove debug information inside a test from the previous commit
2009-12-29 04:33:37 +05:30
Pratik Naik
08633bae5e
Migrate all the calculation methods to Relation
2009-12-29 04:30:04 +05:30
Jeremy Kemper
949c8c0d0e
Don't publicize with_scope for tests since it may shadow public misuse
2009-12-28 14:07:23 -08:00
Jeremy Kemper
d927265abd
Fix pg test
2009-12-28 13:05:36 -08:00
Jeremy Kemper
9fe42232f1
Merge commit 'Fingertips/master'
2009-12-28 12:50:56 -08:00
Eloy Duran
c23fbd0d47
Refactored previous changes to nested attributes.
2009-12-28 21:09:22 +01:00
Michael Siebert
07b615fb89
Add an :update_only option to accepts_nested_attributes_for for to-one associations. [ #2563 state:resolved]
...
Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com >
2009-12-28 21:09:19 +01:00
Jeremy Kemper
632df063a3
Merge commit 'josevalim/validations'
2009-12-28 11:13:35 -08:00
Eloy Duran
9c771a9608
Make sure to not add autosave callbacks multiple times. [ #3575 state:resolved]
...
This makes sure that, in a HABTM association, only one join record is craeted.
2009-12-28 16:56:31 +01:00
Murray Steele
ff508640e2
Make polymorphic_inverse_of in Reflection throw an InverseOfAssociationNotFoundError if the supplied class doesn't have the appropriate association. [ #3520 state:resolved]
...
Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com >
2009-12-28 15:12:17 +01:00
Murray Steele
6a74ee7f4d
Provide a slightly more robust we_can_set_the_inverse_on_this? method for polymorphic belongs_to associations. [ #3520 state:resolved]
...
Also add a new test for polymorphic belongs_to that test direct accessor assignment, not just .replace assignment.
Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com >
2009-12-28 15:12:15 +01:00
George Ogata
81ca0cf2b0
Add inverse polymorphic association support. [ #3520 state:resolved]
...
Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com >
2009-12-28 15:12:13 +01:00