aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
Commit message (Collapse)AuthorAgeFilesLines
* Adds test to check that circular preloading does not modify Model.unscoped ↵Benedikt Deicke2012-04-033-4/+8
| | | | (as described in #5667)
* Removes caching from ActiveRecord::Core::ClassMethods#relationBenedikt Deicke2012-04-031-0/+4
| | | | | | | | | | | The #relation method gets called in four places and the return value was instantly cloned in three of them. The only place that did not clone was ActiveRecord::Scoping::Default::ClassMethods#unscoped. This introduced a bug described in #5667 and should really clone the relation, too. This means all four places would clone the relation, so it doesn't make a lot of sense caching it in the first place. The four places with calls to relations are: activerecord/lib/active_record/scoping/default.rb:110:in `block in build_default_scope'" activerecord/lib/active_record/scoping/default.rb:42:in `unscoped'" activerecord/lib/active_record/scoping/named.rb:38:in `scoped'" activerecord/lib/active_record/scoping/named.rb:52:in `scope_attributes'"
* Fix #5667. Preloading should ignore scoping.Jon Leighton2012-03-301-0/+11
|
* fix testJon Leighton2012-03-301-1/+2
|
* whitespace :scissors:Jon Leighton2012-03-302-5/+4
|
* Merge pull request #5334 from courtland/masterJon Leighton2012-03-304-1/+25
|\ | | | | Fix deleting from a HABTM join table upon destroying an object of a model with optimistic locking enabled.
| * Tests for removing a HABTM association when optimistic locking is enabled.Nick Rogers2012-03-074-1/+25
| |
* | Add Relation#find_by and Relation#find_by!Jon Leighton2012-03-302-0/+48
| |
* | Merge pull request #2945 from Casecommons/nested_attributes_moduleJon Leighton2012-03-302-0/+14
|\ \ | | | | | | Nested attribute setters can be overridden.
| * | Nested attribute setters can be overridden.Jonathan Mukai & Peter Jaros2012-03-282-0/+14
| | | | | | | | | | | | Overriding implementation can call super.
* | | Deprecate Column#type_cast_codeCarlos Antonio da Silva2012-03-291-4/+0
| | |
* | | Add ActiveRecord::Base#slice to slice method callsGuillermo Iguaran2012-03-291-0/+12
|/ /
* | attributes are cached by string keys, so to_s to support symbols. fixes #5549Aaron Patterson2012-03-272-1/+16
| |
* | removed unused variablesArun Agrawal2012-03-271-2/+2
| |
* | ActiveRecord::Coders::YAMLColumn#dump should raise an errorGuten2012-03-261-0/+7
| | | | | | | | | | | | | | | | closes #2737 Conflicts: activerecord/lib/active_record/coders/yaml_column.rb
* | properly namespace the fixture exceptionAaron Patterson2012-03-221-1/+1
| |
* | Deprecate eager-evaluated scopes.Jon Leighton2012-03-2117-71/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't use this: scope :red, where(color: 'red') default_scope where(color: 'red') Use this: scope :red, -> { where(color: 'red') } default_scope { where(color: 'red') } The former has numerous issues. It is a common newbie gotcha to do the following: scope :recent, where(published_at: Time.now - 2.weeks) Or a more subtle variant: scope :recent, -> { where(published_at: Time.now - 2.weeks) } scope :recent_red, recent.where(color: 'red') Eager scopes are also very complex to implement within Active Record, and there are still bugs. For example, the following does not do what you expect: scope :remove_conditions, except(:where) where(...).remove_conditions # => still has conditions
* | Remove valid_scope_name? check - use rubyJon Leighton2012-03-211-19/+0
| | | | | | | | | | | | | | scope is syntactic sugar for defining a class method. Ruby allows redefining methods but emits a warning when run with -w. So let's not implement our own logic for this. Users should run with -w if they want to be warned about redefined methods.
* | changed all.map to pluckSandeep2012-03-191-1/+1
| |
* | Merge pull request #3329 from armstrjare/autosave_collection_new_record_bugJosé Valim2012-03-181-0/+10
|\ \ | | | | | | Autosave association doesn't save all records on a new record for a collection association if there are records marked for destruction
| * | Fix bug with autosave collection association on new record with a marked for ↵Jared Armstrong2012-03-181-0/+10
| | | | | | | | | | | | destroy record in autosave collection.
* | | Fix typo in ActiveRecord::Relation#blank? testRuben Davila2012-03-171-1/+1
| | |
* | | Merge pull request #5321 from pfeiffer/uniqueness_validator_conditionsJosé Valim2012-03-171-0/+12
|\ \ \ | | | | | | | | Add :conditions option to uniqueness validator
| * | | Change syntax to accept an AR::Relation instead of old conditions hash/array.Mattias Pfeiffer2012-03-071-1/+1
| | | |
| * | | Add :conditions option to uniqueness validatorMattias Pfeiffer2012-03-071-0/+12
| | | |
* | | | Fix ActiveRecord::Relation#blank? testsRafael Mendonça França2012-03-161-12/+15
| | | |
* | | | Merge pull request #5469 from yakko/masterJosé Valim2012-03-161-0/+19
|\ \ \ \ | |_|/ / |/| | | tests for Relation .present? .blank?
| * | | test relation presence fixThiago Almeida2012-03-161-4/+4
| | | |
| * | | tests for Relation .present? and .blank? are check cases and shouldn't force ↵Thiago Almeida2012-03-161-0/+19
| | | | | | | | | | | | | | | | sql-count
* | | | Merge pull request #5327 from kennyj/fix_explicitly_inheraitance_columnAaron Patterson2012-03-151-0/+10
|\ \ \ \ | |/ / / |/| | | Don't reset inheritance_column when setting explicitly.
| * | | Don't reset inheritance_column when setting explicitly.kennyj2012-03-081-0/+10
| |/ /
* | | Address the dump file format for hstoreYasuo Honda2012-03-151-1/+1
| | |
* | | Fix GH #5430. A Payload name for schema_search_path should be SCHEMA.kennyj2012-03-151-0/+7
| | |
* | | Remove IdentityMapCarlos Antonio da Silva2012-03-1312-695/+23
| | |
* | | Fix GH #5399. connection_pools's keys are ↵kennyj2012-03-141-1/+7
| | | | | | | | | | | | ActiveRecord::Base::ConnectionSpecification objects.
* | | make sure connections returned after close are marked as in_useAaron Patterson2012-03-121-0/+10
| | |
* | | Add dynamic find_or_create_by_{attribute}! method.Andrew White2012-03-124-0/+52
| | |
* | | fix activerecord query_method regression with offset into FixnumDenis Jean2012-03-121-0/+4
| | | | | | | | | | | | | | | | | | add test to show offset query_methods on mysql & mysql2 change test to cover public API
* | | In AR depths use &:to_i before :uniq to process mixed arrays likes ["1", 1] ↵Alexey Vakhov2012-03-091-0/+7
| | | | | | | | | | | | correct
* | | ensure that released connections move between threadsAaron Patterson2012-03-081-0/+18
| | |
* | | make active_connection? return true only if there is an open connection in ↵Aaron Patterson2012-03-081-0/+35
| | | | | | | | | | | | use for the current thread. fixes #5330
* | | Merge pull request #5306 from kennyj/fix_69c7f02José Valim2012-03-082-2/+2
|\ \ \ | | | | | | | | Change the message string to use in test case.
| * | | Change the string to use in test case.kennyj2012-03-072-2/+2
| |/ /
* | | Merge pull request #5289 from rafaelfranca/fix-through-associationsJon Leighton2012-03-084-4/+33
|\ \ \ | | | | | | | | Fix has_many through associations when mass_assignment_sanitizer is strict
| * | | Not need to pass join attributes to association buildRafael Mendonça França2012-03-073-12/+11
| | | |
| * | | Add test case to has_many through association when mass_assignment_sanitizer isRafael Mendonça França2012-03-054-4/+34
| |/ / | | | | | | | | | :strict
* | | Merge pull request #5162 from kennyj/schema_cache_dumpAaron Patterson2012-03-071-0/+15
|\ \ \ | |_|/ |/| | [Proposal] Schema cache dump
| * | Add support schema cache dump and load.kennyj2012-03-011-0/+15
| | |
* | | Add tests to test that through associations are not readonly, and we can ↵kuahyeow2012-03-081-0/+11
| | | | | | | | | | | | update the records we retrive from the association
* | | Merge pull request #5315 from ↵Aaron Patterson2012-03-071-2/+41
|\ \ \ | | | | | | | | | | | | | | | | travisjeffery/enhance_postgresql_adapter_schema_support Enhance PostgreSQL Adapter schema support