aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models
Commit message (Collapse)AuthorAgeFilesLines
...
* Explicitely setting `autosave => false' should override new_record ↵Eloy Duran2009-09-121-0/+5
| | | | | | autosaving. [#2214 state:resolved] Original author is Jacob.
* Raise an exception with friendlier error message when attempting to build a ↵Mike Breen2009-09-121-0/+2
| | | | | | polymorphic belongs_to with accepts_nested_attributes_for. [#2318 state:resolved] Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
* Refactor new callbacks and AR implementation.José Valim2009-09-083-3/+20
| | | | Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Changed ActiveRecord to use new callbacks and speed up observers by only ↵José Valim2009-09-083-5/+10
| | | | | | notifying events that are actually being consumed. Signed-off-by: Joshua Peek <josh@joshpeek.com>
* has_many :through create should not raise validation errorsrailsbob2009-08-092-0/+6
| | | | | | [#2934 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Prevent overwriting of table name in merging SQL conditions [#2949 ↵Tristan Dunn2009-08-101-1/+5
| | | | state:resolved]
* Enable has_many :through for going through a has_one association on the join ↵Gabe da Silveira2009-08-101-0/+1
| | | | | | model [#2719 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Fix for nested :include with namespaced models.Rich Bradley2009-08-091-1/+1
| | | | [#260 state:committed]
* Adding :from scoping to ActiveRecord calculationsMatt Duncan2009-08-091-0/+2
| | | | | Signed-off-by: Michael Koziarski <michael@koziarski.com> [#1229 state:committed]
* added Subject#after_initialize to be the same as Topic#after_initializeRaimonds Simanovskis2009-08-061-1/+9
|
* added :order option to find :first methods and associations as otherwise ↵Raimonds Simanovskis2009-08-061-2/+6
| | | | | | | | Oracle tests were failing Oracle stores '' string as NULL Oracle cannot have identifiers larger than 30 characters added missing fixtures to test setup method
* Add simple support for ActiveModel's StateMachine for ActiveRecordJoshua Peek2009-08-041-0/+27
|
* Revert "Methods invoked within named scope Procs should respect the scope ↵Jeremy Kemper2009-07-291-2/+0
| | | | | | | | | | stack. [#1267 state:resolved]" This reverts commit 6a13376525f34a00e013fc3a6022838329dfe856. Conflicts: activerecord/test/cases/named_scope_test.rb
* Add primary_key option to belongs_to associationSzymon Nowak2009-07-155-1/+9
| | | | | | [#765 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Revert "Revert "Generate proper :counter_sql from :finder_sql when there is ↵Pratik Naik2009-07-012-0/+10
| | | | | | | | | a newline character immediately following 'SELECT' [#2118 state:resolved]"" This reverts commit 80f1f863cd0f9cba89079511282de5710a2e1832. The feature doesn't work on Postgres, so don't test it on Postgres. Also, Postgres compatibility is irrelevant to the ticket/patch in question.
* Revert "Generate proper :counter_sql from :finder_sql when there is a ↵Yehuda Katz + Carl Lerche2009-06-222-10/+0
| | | | | | | | newline character immediately following 'SELECT' [#2118 state:resolved]" This reverts commit 4851ca9e13a4317342df02ae25b1929340523f7a. The tests do not pass for postgresql.
* Generate proper :counter_sql from :finder_sql when there is a newline ↵Patrick Joyce2009-06-212-0/+10
| | | | | | character immediately following 'SELECT' [#2118 state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Ensure hm:t#create respects source associations hash conditions [#2090 ↵mattbauer2009-06-211-0/+2
| | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Merge branch 'master' into active_modelJoshua Peek2009-05-298-0/+34
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: activemodel/lib/active_model/core.rb activemodel/test/cases/state_machine/event_test.rb activemodel/test/cases/state_machine/state_transition_test.rb activerecord/lib/active_record/validations.rb activerecord/test/cases/validations/i18n_validation_test.rb activeresource/lib/active_resource.rb activeresource/test/abstract_unit.rb
| * Make sure default_scope#create checks for options[:conditions] [#2181 ↵Pratik Naik2009-05-181-0/+10
| | | | | | | | state:resolved] [James Le Cuirot]
| * Fixed limited eager loading associations with numbers in the name [#2668 ↵Benjamin Floering2009-05-181-0/+1
| | | | | | | | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
| * Cherry-pick core extensionsJeremy Kemper2009-05-131-0/+2
| |
| * Revert "Fixed bug with polymorphic has_one :as pointing to an STI record"Jeremy Kemper2009-05-111-4/+0
| | | | | | | | | | | | [#2594 state:open] This reverts commit 99c103be1165da9c8299bc0977188ecf167e06a5.
| * Allow you to pass :all_blank to :reject_if option to automatically create a ↵Mike Breen2009-05-101-0/+2
| | | | | | | | Proc that will reject any record with blank attributes.
| * Providing support for :inverse_of as an option to associations.Murray Steele2009-05-044-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | You can now add an :inverse_of option to has_one, has_many and belongs_to associations. This is best described with an example: class Man < ActiveRecord::Base has_one :face, :inverse_of => :man end class Face < ActiveRecord::Base belongs_to :man, :inverse_of => :face end m = Man.first f = m.face Without :inverse_of m and f.man would be different instances of the same object (f.man being pulled from the database again). With these new :inverse_of options m and f.man are the same in memory instance. Currently :inverse_of supports has_one and has_many (but not the :through variants) associations. It also supplies inverse support for belongs_to associations where the inverse is a has_one and it's not a polymorphic. Signed-off-by: Murray Steele <muz@h-lame.com> Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
| * Fixed bug with polymorphic has_one :as pointing to an STI recordRuy Asan2009-05-011-0/+4
| | | | | | | | | | | | [#2594 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* | Merge branch 'master' into active_modelPratik Naik2009-04-224-9/+10
|\| | | | | | | | | Conflicts: activeresource/lib/active_resource/validations.rb
| * Fix tests for sqlite3 3.6.xxPratik Naik2009-04-211-1/+1
| |
| * Ensure :dependent => :delete_all works for association with hash conditionsPratik Naik2009-04-202-8/+7
| |
| * Ensure JoinAssociation uses aliased table name when multiple associations ↵Pratik Naik2009-04-201-0/+2
| | | | | | | | have hash conditions on the same table
| * Added :touch option to belongs_to associations that will touch the parent ↵David Heinemeier Hansson2009-04-161-1/+1
| | | | | | | | record when the current record is saved or destroyed [DHH]
* | Deprecate Model#validate/validate_on_create/validate_on_update. Use ↵Pratik Naik2009-03-213-9/+19
| | | | | | | | Model.validate :method and likewise
* | 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>