aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
Commit message (Collapse)AuthorAgeFilesLines
* fix ActiveRecord `destroy_all` so it returns destroyed recordsMislav Marohnić2010-07-082-8/+19
| | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* mass_assignment_security moved from AR to AMo, and minor test cleanupJosh Kalderimis2010-07-087-194/+11
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* minor changes to mass assignment security patch to bring it in line with ↵Josh Kalderimis2010-07-084-131/+135
| | | | | | rails standards Signed-off-by: José Valim <jose.valim@gmail.com>
* Mass assignment security refactoringEric Chapweske2010-07-085-13/+135
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* This test never runs and it has never run. Since the day this fileNeeraj Singh2010-07-081-4/+0
| | | | | | | | was created this test has name not beginning with test_. Also this test is trying to use has_many on another has_many which is not supported. Signed-off-by: José Valim <jose.valim@gmail.com>
* Fixed gruoped_by_title spelling [#5063 state:committed]Ben Somers2010-07-082-3/+3
| | | | Signed-off-by: Xavier Noria <fxn@hashref.com>
* adding some behavioral tests for the sqlite adapter. [#5065 state:resolved]Aaron Patterson2010-07-071-0/+100
| | | | Signed-off-by: wycats <wycats@gmail.com>
* Don't remove scheduled destroys when loading an association. [#4642 ↵James Le Cuirot2010-07-011-0/+6
| | | | | | state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* AssociationCollection#create_by_*, find_or_create_by_* work properly now. ↵Aaron Patterson2010-06-291-0/+62
| | | | | | [#1108 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Test that adding an index also doesn't raise an exception.J. Pablo Fernández2010-06-291-1/+1
| | | | | | [#4809 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Replaced statement in comment with an assertionPaul Barry2010-06-291-2/+3
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Fixed error when removing an index from a table name values, which is a ↵J. Pablo Fernández2010-06-291-0/+16
| | | | | | reserved word, with test. Signed-off-by: José Valim <jose.valim@gmail.com>
* Push a failing test for issues [#4994] and [#5003].José Valim2010-06-292-0/+9
|
* Remove ActiveRecord::Base#class_name [#379 state:committed]David Trasbo2010-06-291-19/+0
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Add scoping and unscoped as the syntax to replace the old with_scope and ↵José Valim2010-06-295-206/+405
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with_exclusive_scope. A few examples: * with_scope now should be scoping: Before: Comment.with_scope(:find => { :conditions => { :post_id => 1 } }) do Comment.first #=> SELECT * FROM comments WHERE post_id = 1 end After: Comment.where(:post_id => 1).scoping do Comment.first #=> SELECT * FROM comments WHERE post_id = 1 end * with_exclusive_scope now should be unscoped: class Post < ActiveRecord::Base default_scope :published => true end Post.all #=> SELECT * FROM posts WHERE published = true Before: Post.with_exclusive_scope do Post.all #=> SELECT * FROM posts end After: Post.unscoped do Post.all #=> SELECT * FROM posts end Notice you can also use unscoped without a block and it will return an anonymous scope with default_scope values: Post.unscoped.all #=> SELECT * FROM posts
* with_exclusive_scope does not work properly if ARel is passed. It does work ↵Neeraj Singh2010-06-292-1/+13
| | | | | | | | nicely if hash is passed. Blow up if user is attempting it pass ARel to with_exclusive_scope. [#3838 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Move sqlite to sqlite3 for this tests to be run only on sqlite3 adapterSantiago Pastorino2010-06-282-0/+0
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Fixes #2415 by creating a new instance of the Model when saving attributes ↵George Montana Harkin2010-06-271-13/+15
| | | | | | to that model and the associated attributes already exist. Tests included. [#2415 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* adding adapter tests, avoiding private apis, fixing code in 1.9 [#4986 ↵Aaron Patterson2010-06-261-0/+56
| | | | | | state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* blocks removed from all the ActiveRelation query_methods, extend method ↵Santiago Pastorino2010-06-261-1/+1
| | | | | | added instead Signed-off-by: José Valim <jose.valim@gmail.com>
* Merge branch 'tago'José Valim2010-06-262-7/+107
|\
| * Add column and index query methods to ActiveRecord::SchemaAndrew White2010-06-262-7/+107
| | | | | | | | | | | | [#4219 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* | index dump should not include full text indexes. Thanks Ken Mayer for the ↵Aaron Patterson2010-06-261-0/+4
| | | | | | | | | | | | original patch! [#4949 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* | reorder method added to ActiveRelationSantiago Pastorino2010-06-261-0/+6
| | | | | | | | | | | | [#4972 state:committed] Signed-off-by: José Valim <jose.valim@gmail.com>
* | Test for concatenated orders addedSantiago Pastorino2010-06-262-1/+7
| | | | | | | | | | | | [#4972] Signed-off-by: José Valim <jose.valim@gmail.com>
* | reorganizing adapter specific tests. [#4974 state:resolved]Aaron Patterson2010-06-2512-2/+2
|/ | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Order is not guaranteed here, ordering by id of people table makes it workSantiago Pastorino2010-06-251-2/+2
|
* Support for multiple selects addedNeeraj Singh and Santiago Pastorino2010-06-252-3/+11
| | | | [#4841 state:committed]
* Remove deprecated block usage in composed_of.Emilio Tagua2010-06-241-28/+0
|
* Move Rails::LogSubscriber to ActiveSupport::LogSubscriber, allowing ↵José Valim2010-06-241-5/+4
| | | | frameworks like ActiveRecord and ActiveResource to log outsude Rails::Application [#4816 state:resolved]
* Add tests for relation count. Fix other tests that were conceptually wrong.Emilio Tagua2010-06-242-2/+6
| | | | | | [#4882 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* adding fix for to_xml for ActiveRecord relation objectNeeraj Singh2010-06-231-0/+5
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* ActiveRecord's relation object should respond to to_json and to_yamlNeeraj Singh2010-06-231-0/+10
| | | | | | [#4547 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* adding column named 'group' to ensure that nothing breaks given that 'group' ↵Neeraj Singh2010-06-233-6/+7
| | | | | | | | is sql reserved word [#4945 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Don't clone associations [#4894 state:resolved]Paul Gillard2010-06-231-0/+8
| | | | | | Cloning an active record object should be shallow in that it should copy attributes but not associations. This was no longer true as a result of #3164. Signed-off-by: José Valim <jose.valim@gmail.com>
* remove_column should raise an ArgumentError when no columns are passed ↵Jeff Dean2010-06-231-0/+4
| | | | | | [#4803 state:resolved] Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Avoid method redefined warningSantiago Pastorino2010-06-221-1/+4
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* test for #4917Neeraj Singh2010-06-221-0/+7
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Fix order method to accept relation attributes.Emilio Tagua2010-06-221-2/+6
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Make ActiveModel::Errors#add_on_blank and #add_on_empty accept an options ↵Jeroen van Dijk2010-06-212-28/+34
| | | | | | | | | | | | | | | | hash and make various Validators pass their (filtered) options. This makes it possible to pass additional options through Validators to message generation. E.g. plugin authors want to add validates_presence_of :foo, :format => "some format". Also, cleanup the :default vs :message options confusion in ActiveModel validation message generation. Also, deprecate ActiveModel::Errors#add_on_blank(attributes, custom_message) in favor of ActiveModel::Errors#add_on_blank(attributes, options). Also, refactoring of ActiveModel and ActiveRecord Validation tests. Test are a lot more DRY now. Better test coverage as well now. The first four points were reapplied from an older patch of Sven Fuchs which didn't apply cleanly anymore and was not complete yet. Signed-off-by: José Valim <jose.valim@gmail.com>
* remove executable permission from files that don't need it. [#4802 ↵rohit2010-06-202-0/+0
| | | | | | state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Don't overwrite unsaved updates when loading an association but preserve the ↵James Le Cuirot2010-06-202-2/+23
| | | | | | | | order of the loaded records. Reapplied from before but now allows already-saved records to be refreshed. [#4830 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Merge branch 'master' of github.com:rails/railsJosé Valim2010-06-203-12/+18
|\
| * Fix test which prevents connection reset on failing and remove hardcoded ↵Master Lambaster2010-06-181-8/+7
| | | | | | | | | | | | | | | | connection [#4689 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
| * Fix bug with rolling back frozen attributes.Brian Durand2010-06-182-4/+11
| | | | | | | | | | | | [#2991] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* | ActiveRecord and ActionPack now use the new descendants implementation.José Valim2010-06-191-4/+0
|/
* use assert_in_delta() for floating point comparisons in tests [#4871 ↵Aaron Patterson2010-06-161-1/+1
| | | | | | state:resolved] Signed-off-by: Carl Lerche <carllerche@mac.com>
* edit pass: the names of Rails components have a space, ie, "Active Record", ↵Xavier Noria2010-06-141-1/+1
| | | | not "ActiveRecord"
* Revert "Don't overwrite unsaved updates when loading an association but ↵José Valim2010-06-112-16/+2
| | | | | | | | preserve the order of the loaded records. [#4642 state:open]" This commit introduced a regression described in ticket [#4830]. This reverts commit 0265c708b9696c3943518ad5f3dabdc22c5eba11.
* Validators should at model level and not at AR:Base level [Closes #4804]Neeraj Singh2010-06-101-0/+10
| | | | | | [#4804 state:resolved] Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>