aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models
Commit message (Collapse)AuthorAgeFilesLines
* Move all the Active Record validations to Active ModelPratik Naik2009-03-191-5/+5
|
* Ensure AutosaveAssociation runs remove callbacks [#2146 state:resolved]Luca Guidi2009-03-121-1/+48
| | | | | Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com> Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Returning nil from named scope lambda is equivalent to an empty hash [#1773 ↵Elijah Miller2009-03-121-1/+3
| | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Ensure has_many :through works with changed primary keys [#736 state:resolved]Jim Remsik and Tim Pope2009-03-093-2/+8
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fix find_by_last when order is given [#2127 state:committed]Jan De Poorter2009-03-091-0/+1
| | | | Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
* Ensure validates_uniqueness_of considers limit on the field. [#1042 ↵Arthur Klepchukov2009-03-071-0/+3
| | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Ensure belongs_to association with a counter cache in name spaced model ↵Adam Cooper2009-03-062-0/+12
| | | | | | works [#1678 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Ensure replacing has_one associations respects the supplied :dependent ↵Dimitri Krassovski2009-03-061-0/+1
| | | | | | option. [#1305 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Methods invoked within named scope Procs should respect the scope stack. ↵jvoorhis2009-03-061-0/+2
| | | | | | [#1267 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fixed bug that makes named_scopes _forgot_ current scopeDiego Algorta2009-02-251-0/+6
|
* Changed API of NestedAttributes to take an array, or hash with index keys, ↵Lance Ivy2009-02-132-3/+3
| | | | | | | | of hashes that have the id on the inside of the attributes hash and updated the FormBuilder to produce such hashes. Also fixed NestedAttributes with composite ids. Signed-off-by: Michael Koziarski <michael@koziarski.com> Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com> [#1892 state:committed]
* Add support for nested object forms to ActiveRecord and the helpers in ↵Eloy Duran2009-02-015-0/+24
| | | | | | | | ActionPack Signed-Off-By: Michael Koziarski <michael@koziarski.com> [#1202 state:committed]
* Make sure inner scope conditions get a preference over the outer onesPratik Naik2009-01-242-0/+8
|
* Preload uses exclusive scope [#643 state:resolved]Frederick Cheung2008-12-261-0/+6
| | | | | | | | | With self referential associations, the scope for the the top level should not affect fetching of associations, for example when doing Person.male.find :all, :include => :friends we should load all of the friends for each male, not just the male friends.
* Fix configure_dependency_for_has_many not quoting conditions properly [#1461 ↵Frederick Cheung2008-12-211-0/+1
| | | | state:resolved]
* Fix preloading of has_one :through associations on belongs_to [#1507 ↵Matt Jones2008-12-183-0/+5
| | | | | | state:resolved] Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com>
* Add :having option to find, to use in combination with grouped finds. Also ↵miloops2008-12-013-0/+3
| | | | | | | added to has_many and has_and_belongs_to_many associations. Signed-off-by: Michael Koziarski <michael@koziarski.com> [#1028 state:committed]
* Fix default_scope to work in combination with named scopesTom Stuart2008-11-171-7/+7
| | | | Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
* Added default_scope to Base [#1381 state:committed] (Paweł Kondzior)Pratik Naik2008-11-161-0/+12
|
* Revert "Added default_scope to Base [#1381 state:committed] (Paweł ↵David Heinemeier Hansson2008-11-161-12/+0
| | | | | | Kondzior)" -- won't gel with threads. This reverts commit ff594b2bc94ff2a942fe6ca05672387722dee686.
* Added default_scope to Base [#1381 state:committed] (Paweł Kondzior)David Heinemeier Hansson2008-11-161-0/+12
|
* fix assignment to has_one :through associations.Matt Jones2008-11-153-0/+10
| | | | Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Ensure association proxy responds to private class methods defined in ↵Pratik Naik2008-10-161-0/+8
| | | | associated class. [#1083]
* Ensure methods called on association proxies respect access control. [#1083 ↵Pratik Naik2008-10-132-1/+18
| | | | state:resolved] [Adam Milligan, Pratik]
* explicitly including child associations that are also included in the parent ↵Will Bryant2008-10-102-0/+3
| | | | | | | association definition should not result in double records in the collection/double loads (#1110) Signed-off-by: Michael Koziarski <michael@koziarski.com> [#1110 state:committed]
* Fix has_many :through when the source is a belongs_to association. [#323 ↵Zach Dennis2008-10-041-0/+2
| | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Allow for the dirty tracking to work with the aliased name of aliased ↵Rich Cavanaugh2008-09-131-0/+1
| | | | | | | attributes. Signed-off-by: Michael Koziarski <michael@koziarski.com> [#812 state:committed]
* Use select and change test so new tests can work on postgres.miloops2008-09-122-3/+3
| | | | Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Improve test coverage when using the group option in find, has_many or ↵miloops2008-09-112-0/+5
| | | | | | has_and_belongs_to_many. Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Revert "Add :accessible option to Associations for allowing mass assignments ↵Pratik Naik2008-09-102-7/+1
| | | | | | | | | | | | using hash. [#474 state:resolved]" This reverts commit e0750d6a5c7f621e4ca12205137c0b135cab444a. Conflicts: activerecord/CHANGELOG activerecord/lib/active_record/associations.rb activerecord/lib/active_record/associations/association_collection.rb
* Added :constructor and :converter options to composed_of and deprecated the ↵Rob Anderton2008-09-101-1/+19
| | | | | | conversion block Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Support :limit on update_all so that has_many with :limit can be safely updatedTarmo Tänav2008-09-101-0/+1
| | | | Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Fixed ordering in ↵Tarmo Tänav2008-08-221-1/+1
| | | | test_find_in_association_with_custom_finder_sql_and_multiple_interpolations
* Fix generated WHERE IN query for named scopes. [#583 state:resolved]Philip Hallstrom2008-08-211-0/+2
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Test for eager loading of STI subclasses from htm associationsTarmo Tänav2008-08-161-0/+3
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fix file permissionsTarmo Tänav2008-07-313-0/+0
| | | | Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Use klass.sti_name to make sure associations take store_full_sti_class into ↵Daniel Guettler2008-07-221-0/+7
| | | | | | account. [#671 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Add :accessible option to Associations for allowing mass assignments using ↵David Dollar2008-07-142-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | hash. [#474 state:resolved] Allows nested Hashes (i.e. from nested forms) to hydrate the appropriate ActiveRecord models. class Post < ActiveRecord::Base belongs_to :author, :accessible => true has_many :comments, :accessible => true end post = Post.create({ :title => 'Accessible Attributes', :author => { :name => 'David Dollar' }, :comments => [ { :body => 'First Post!' }, { :body => 'Nested Hashes are great!' } ] }) post.comments << { :body => 'Another Comment' } Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Ensure NamedScope#build/create/create!/new works as expected when named ↵Daniel Guettler2008-07-091-0/+2
| | | | | | scope has hash conditions. [Daniel Guettler, Pratik Naik] [#419 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Add support for :primary_key option to has_one as well as has_many so that a ↵Brad Greenlee2008-07-061-0/+1
| | | | | | key other than the default primary key can be used for the association Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Add has_many :primary_key option to allow setting the primary key on a has ↵Andre Arko2008-07-061-0/+2
| | | | | | many association Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Add extra hash conditions tests for named_scopePratik Naik2008-06-281-0/+1
|
* Fix column collision with named_scope and :joins. [#46 state:resolved]Mark Catley2008-06-221-1/+6
|
* Fixed that scopes defined with a string name could not be composedTarmo Tänav2008-06-221-0/+1
|
* fix mergerick2008-06-192-2/+5
|\
| * Disable validations for associated belongs_to record by defaultPratik Naik2008-06-111-2/+2
| |
| * Add :validate option to associations. [#301 state:resolved]Jan De Poorter2008-06-112-1/+4
| | | | | | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* | fix eager loading with dynamic findersBrandon Keepers2008-06-093-1/+3
|/
* Fix faulty tests introduced in 8d0b4fa39Michael Koziarski2008-05-241-1/+1
|
* Added :select option to has_one and belongs_to, remove unused :order option ↵josevalim2008-05-241-0/+2
| | | | | | | on belongs_to. Signed-off-by: Michael Koziarski <michael@koziarski.com> [#241 state:resolved]