aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models
Commit message (Collapse)AuthorAgeFilesLines
...
* 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]
* Add ActiveRecord option to store the full class name on STI's type column, ↵Rodrigo Kochenburger2008-05-131-0/+4
| | | | | | allowing one to have STI subclasses in different namespaces [#114] Signed-off-by: rick <technoweenie@gmail.com>
* Dirty attributes aren't cleared if save fails. [#174 state:resolved]Xavier Noria2008-05-121-0/+2
| | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Ensure hm:t preloading honours reflection options. [#137 state:resolved]Frederick Cheung2008-05-111-0/+4
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fix validates_uniqueness_of for SQL keywords [#23 state:resolved]Alex MacCaw2008-05-111-0/+2
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Calling ActiveRecord#inspect on an unloaded association won't wipe the ↵Andreas Neuhaus2008-05-081-0/+4
| | | | | | collection [#9 state:resolved] Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Ensure correct record is returned when preloading has_one where more than ↵Frederick Cheung2008-05-061-0/+2
| | | | | | | one row exists Signed-off-by: Michael Koziarski <michael@koziarski.com> [#73 state:closed]
* Added missing filesDavid Heinemeier Hansson2008-05-011-0/+4
|
* Fixed AssociationsPreload such that it doesnt require foreign keys to be ↵David Heinemeier Hansson2008-04-301-0/+2
| | | | integers (fcheung) [#33 state:resolved]
* Change tests against all scope to base scope as all is now used as a finder ↵David Heinemeier Hansson2008-04-302-0/+3
| | | | alias
* Ensure table names are quoted by the association preloading code.Frederick Cheung2008-04-263-0/+14
| | | | | | [#45 state:resolved] Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Improve ActiveRecord::Base#table_name unit tests for nested classes. Closes ↵Josh Peek2008-04-071-0/+2
| | | | | | #10289. [scott_willson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9237 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Refactor HasManyThroughAssociation to inherit from HasManyAssociation. ↵Pratik Naik2008-04-061-0/+14
| | | | | | Association callbacks and <association>_ids= now work with hm:t. Closes #11516 [rubyruy] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9230 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat: work around YAML serialization error exposed by validations ↵Jeremy Kemper2008-04-011-3/+2
| | | | | | tests git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9192 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that has_many :through would ignore the hash conditions (closes ↵David Heinemeier Hansson2008-03-281-0/+5
| | | | | | #11447) [miloops] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9110 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Merge the has_finder gem, renamed as 'named_scope'. Closes #11404 [nkallen]Rick Olson2008-03-244-0/+34
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9084 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* has_one :through supports :source_type. Fix up some tests. References #4756.Jeremy Kemper2008-03-221-1/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9075 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Allow association scoping for built/created records if :conditions is ↵Rick Olson2008-03-211-0/+3
| | | | | | specified as a hash. Closes #11393 [miloops] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9068 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add has_one :through support, finally. Closes #4756 [thechrisoshow]Rick Olson2008-03-214-0/+28
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9067 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add :readonly option to HasManyThrough associations. Closes #11156 [miloops]Pratik Naik2008-03-071-1/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8989 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make dynamic finders respect the :include on HasManyThrough associations. ↵Michael Koziarski2008-02-182-1/+2
| | | | | | Closes #10998. [cpytel] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8890 5ecf4fe2-1ee6-0310-87b1-e25e094e27de