aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "When creating database with rake, create schemas in ↵Michael Koziarski2010-04-092-13/+0
| | | | | | | | | | | | | schema_search_path if it doesn't exist." This reverts commit 6c2a0675f11a9b5b8e88ed7dbccd65cb51be8029. Reverting because it breaks the ability to run tests using a non-superuser. Conflicts: activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb activerecord/lib/active_record/railties/databases.rake
* Dirty datetime attributes should be aware of time zone info [#3658 ↵Kristopher Murata2010-04-081-0/+95
| | | | | | state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Reset named scope cache whenever the @target is resetPratik Naik2010-04-071-0/+10
|
* Memoize association.named_scope callsPratik Naik2010-04-051-0/+9
|
* Add tests to prevent regression of lazy evaluation of has_many ..., ↵Andrew White2010-04-041-0/+18
| | | | | | | | :dependent => :___ [#2627 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Add Relation extensionsPratik Naik2010-04-021-0/+16
|
* Add tests for postgresql column type mapping updates [#4270 state:resolved]Ernie Miller2010-03-311-0/+17
| | | | Signed-off-by: Emilio Tagua <miloops@gmail.com>
* Dont try to load the record from the db if preloading didn't find anythingPratik Naik2010-03-311-0/+6
|
* Fix failing test in MySQL.Emilio Tagua2010-03-301-3/+8
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Named scopes shouldn't test equality using to_a if it's not an Array, this ↵Emilio Tagua2010-03-301-3/+9
| | | | | | was causing records to be loaded before they were needed. Signed-off-by: José Valim <jose.valim@gmail.com>
* Fix dom_id for ActiveRecord [#4296 state:resolved]José Valim2010-03-301-0/+6
|
* Fix honoring :primary_key option when joining or eager loading a belongs_to ↵Ernie Miller2010-03-291-0/+13
| | | | | | | | association [#765 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Warn scoped order and limit are ignored. [#4123 state:resolved]Emilio Tagua2010-03-291-3/+13
|
* Add the ability to specify table_name_prefix on individual modulesAndrew White2010-03-281-0/+28
| | | | Signed-off-by: wycats <wycats@gmail.com>
* defining a named_scope which overwrites an existing method is now allowed we ↵Matthew Rudy Jacobs2010-03-281-2/+15
| | | | | | | | | just log a warning. This was motivated by the fact that :open is defined on all classes as such the named_scope "open" can never be used, without hacking ActiveRecord with an "undef_method" [#4083 state:resolved] Signed-off-by: wycats <wycats@gmail.com>
* Add :dependent = to has_one and has_many [#3075 state:resolved]Rizwan Reza2010-03-283-2/+24
|
* When creating database with rake, create schemas in schema_search_path if it ↵Rizwan Reza2010-03-282-0/+13
| | | | doesn't exist.
* Revert "primary_key now supports :limit for MySQL". Break Sam Ruby app.José Valim2010-03-271-9/+2
| | | | | | To reproduce, start a new application, create a scaffold and run test suite. [#876 state:open] This reverts commit faeca694b3d4afebf6b623b493e86731e773c462.
* primary_key now supports :limit for MySQLRizwan Reza2010-03-271-2/+9
| | | | Signed-off-by: wycats <wycats@gmail.com>
* Revert "primary_key now supports :limit. [#876 state:resolved]" since it ↵José Valim2010-03-271-9/+2
| | | | | | broke AR test suite. This reverts commit 41e5c7ed44fedb95636ef9b7a792c46ea03309bd.
* primary_key now supports :limit. [#876 state:resolved]Rizwan Reza2010-03-271-2/+9
| | | | Signed-off-by: wycats <wycats@gmail.com>
* Revert "Changed behavior of touch and added touch! Originally implemented by ↵Pratik Naik2010-03-271-25/+0
| | | | | | Obie Fernandez, updated touch! to act as a thin wrapper to touch. [#2520 state:resolved]" This reverts commit 3a875e618487a06a56f6cf912cf5440f294921cc.
* Changed behavior of touch and added touch! Originally implemented by Obie ↵Nathaniel Bibler2010-03-271-0/+25
| | | | | Fernandez, updated touch! to act as a thin wrapper to touch. [#2520 state:resolved] Signed-off-by: wycats <wycats@gmail.com>
* In PostgreSQLAdapter, switch tables query to use current_schemas function ↵Kris Selden2010-03-261-0/+9
| | | | | | [#918 state:resolved] Signed-off-by: wycats <wycats@gmail.com>
* Add add_limit_offset! to adapters.Emilio Tagua2010-03-251-0/+21
|
* expand migration paths before requiring them. [#4240 state:resolved]Aaron Patterson2010-03-231-0/+13
| | | | Signed-off-by: wycats <wycats@gmail.com>
* do not use unloadable constants in tests [#4260 state:resolved]Aaron Patterson2010-03-231-2/+1
| | | | Signed-off-by: wycats <wycats@gmail.com>
* Reset class attribute after changing itEvan Phoenix2010-03-221-0/+2
|
* Clear the query cache between tests that test the query cacheEvan Phoenix2010-03-221-0/+4
|
* Remove obsolete use case that was broken in AR::ObserversEvan Phoenix2010-03-221-40/+0
|
* Don't depend on order of elements in SetEvan Phoenix2010-03-221-5/+16
|
* Remove test ordering bug by using another classEvan Phoenix2010-03-221-4/+7
|
* squelching more warnings in the AR tests. [#4218 state:resolved]Aaron Patterson2010-03-183-13/+39
| | | | Signed-off-by: wycats <wycats@gmail.com>
* removing dead code from activerecord tests. [#4187 state:resolved]Aaron Patterson2010-03-154-46/+0
| | | | Signed-off-by: wycats <wycats@gmail.com>
* cleaning up a bunch of parse time warnings in AR [#4186 state:resolved]Aaron Patterson2010-03-159-26/+26
| | | | Signed-off-by: wycats <wycats@gmail.com>
* Hack to keep column metadata queries out of test query countsJeremy Kemper2010-03-151-0/+5
|
* Hack to keep column metadata queries out of test query countsJeremy Kemper2010-03-151-3/+7
|
* restricts a test to < 1.9, and rewrites it using a proper expectationXavier Noria2010-03-132-11/+6
| | | | Signed-off-by: wycats <wycats@gmail.com>
* adds coverage for the issue addressed in fe43bbdXavier Noria2010-03-121-0/+14
| | | | | | [#4166 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fix associations to call :destroy or :delete based on the right :dependent ↵Carlos Antonio da Silva2010-03-094-29/+31
| | | | | | option Signed-off-by: José Valim <jose.valim@gmail.com>
* Make many parts of Rails lazy. In order to facilitate this,wycats2010-03-071-0/+1
| | | | | | | | | | | | add lazy_load_hooks.rb, which allows us to declare code that should be run at some later time. For instance, this allows us to defer requiring ActiveRecord::Base at boot time purely to apply configuration. Instead, we register a hook that should apply configuration once ActiveRecord::Base is loaded. With these changes, brings down total boot time of a new app to 300ms in production and 400ms in dev. TODO: rename base_hook
* Somehow this fixes the AR tests when ran with rake. I should probably figure ↵Carl Lerche2010-03-041-1/+1
| | | | out why.
* Fix active_records' log testsCarl Lerche2010-03-021-2/+3
|
* activerecord test load pathsJoshua Peek2010-02-281-0/+3
|
* ActiveRecord should raise an error on invalid migration types.José Valim2010-02-281-0/+10
|
* fixed a 'RecordNotFound' bug when calling 'reload' on a object which doesn't ↵Tobias Bielohlawek2010-02-261-0/+6
| | | | | | | | met the default_scope conditions, added test [#3166 status:resolved] The reload method didn't made use of 'with_exclusive_scope' when reloading the object. This lead to a RecordNotFound exception, in case the object doesn't met the default_scope condition (anymore) - which is obviously a bug. This quick fix makes use of with_exclusive_scope in the reload method as well. See test for full example. Signed-off-by: José Valim <jose.valim@gmail.com>
* Fix a bug where default_scope was overriding attributes given on model ↵Henry Hsu2010-02-261-0/+10
| | | | | | initialization [#3218 status:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Revert "Fix test load paths for those not using bundler"Carlhuda2010-02-232-8/+2
| | | | | | This reverts commit eec2d301d4ce9df9c71c1a5aa63053eb970b6818. This commit broke tests. You cannot have a file called "bundler" on the load path.
* Require persisted? in ActiveModel::Lint and remove new_record? and ↵José Valim2010-02-211-5/+17
| | | | destroyed? methods. ActionPack does not care if the resource is new or if it was destroyed, it cares only if it's persisted somewhere or not.
* AMo #key is now #to_key and CI is probably happysnusnu2010-02-201-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Obviously #key is a too common name to be included in the AMo interface, #to_key fits better and also relates nicely to #to_param. Thx wycats, koz and josevalim for the suggestion. AR's #to_key implementation now takes customized primary keys into account and there's a testcase for that too. The #to_param AMo lint makes no assumptions on how the method behaves in the presence of composite primary keys. It leaves the decision wether to provide a default, or to raise and thus signal to the user that implementing this method will need his special attention, up to the implementers. All AMo cares about is that #to_param is implemented and returns nil in case of a new_record?. The default CompliantObject used in lint_test provides a naive default implementation that just joins all key attributes with '-'. The #to_key default implementation in lint_test's CompliantObject now returns [id] instead of [1]. This was previously causing the (wrong) tests I added for AR's #to_key implementation to pass. The #to_key tests added with this patch should be better. The CI failure was caused by my lack of knowledge about the test:isolated task. The tests for the record_identifier code in action_controller are using fake non AR models and I forgot to stub the #to_key method over there. This issue didn't come up when running the test task, only test:isolated revealed it. This patch fixes that. All tests pass isolated or not, well, apart from one previously unpended test in action_controller that is unrelated to my patch.