Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Merge pull request #7822 from lulalala/reset-counter-cache-for-has-many-through | Rafael Mendonça França | 2012-10-02 | 1 | -1/+1 |
| | | | | | | | Fix reset_counters crashing on has_many :through associations. Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/counter_cache.rb | ||||
* | set the configured #inheritance_column on #become (#7503) | Yves Senn | 2012-09-03 | 1 | -0/+14 |
| | | | | | | | | | | | | | | | | | | | I had to create a new table because I needed an STI table, which does not have both a "type" and a "custom_type" the test fails with: 1) Error: test_alt_becomes_works_with_sti(InheritanceTest): NoMethodError: undefined method `type=' for #<Cabbage id: 1, name: "my cucumber", custom_type: "Cucumber"> /Users/username/Projects/rails/activemodel/lib/active_model/attribute_methods.rb:432:in `method_missing' /Users/username/Projects/rails/activerecord/lib/active_record/attribute_methods.rb:100:in `method_missing' /Users/username/Projects/rails/activerecord/lib/active_record/persistence.rb:165:in `becomes' test/cases/inheritance_test.rb:134:in `test_becomes_works_with_sti' test/cases/inheritance_test.rb:140:in `test_alt_becomes_works_with_sti' Conflicts: activerecord/test/cases/inheritance_test.rb | ||||
* | Ensure association preloading properly merges default scope and association ↵ | Pratik Naik | 2012-08-28 | 2 | -0/+12 |
| | | | | | | | | conditions Conflicts: activerecord/test/models/reader.rb | ||||
* | Use Ruby 1.8 hash syntax | Carlos Antonio da Silva | 2012-08-21 | 2 | -3/+3 |
| | | | | Introduced in backport 648c5a1369ed64608c3ca43a5ebc917687d20010. | ||||
* | Merge pull request #5210 from Pliny/masteri | Rafael Mendonça França | 2012-08-21 | 2 | -0/+6 |
| | | | | | | | | Fix for #5200 Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/counter_cache.rb | ||||
* | Ported PR #4856 to 3-2-stable. | Jeremy Walker | 2012-08-09 | 1 | -0/+1 |
| | |||||
* | Revert "Deprecating composed_of in ActiveRecord" | Rafael Mendonça França | 2012-08-01 | 2 | -9/+5 |
| | | | | This reverts commit 44b313bc4e3762da64dde7894548f81c595147de. | ||||
* | Revert "Deprecate :finder_sql, :counter_sql, :insert_sql, :delete_sql." | Jon Leighton | 2012-08-01 | 3 | -36/+26 |
| | | | | | | | | | | This reverts commit a79bfa92e7bdc31b346d13ee5447d3fdac382bfb. Conflicts: activerecord/CHANGELOG.md We shouldn't introducing deprecations in point releases. It will be deprecated in 4.0 instead. | ||||
* | Deprecate :finder_sql, :counter_sql, :insert_sql, :delete_sql. | Jon Leighton | 2012-07-20 | 3 | -26/+36 |
| | |||||
* | Deprecating composed_of in ActiveRecord | Steve Klabnik | 2012-06-18 | 2 | -5/+9 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This feature adds a lot of complication to ActiveRecord for dubious value. Let's talk about what it does currently: class Customer < ActiveRecord::Base composed_of :balance, :class_name => "Money", :mapping => %w(balance amount) end Instead, you can do something like this: def balance @balance ||= Money.new(value, currency) end def balance=(balance) self[:value] = balance.value self[:currency] = balance.currency @balance = balance end Since that's fairly easy code to write, and doesn't need anything extra from the framework, if you use composed_of today, you'll have to add accessors/mutators like that. This feature will be removed in Rails 4. | ||||
* | Restore behavior of Active Record 3.2.3 scopes | Andrew White | 2012-06-01 | 1 | -2/+0 |
| | | | | | | | | | | | | | | A series of commits relating to preloading and scopes caused a regression. Cloning the relation calls initialize_copy which resets a number of instance variables to nil. Without this the scope thinks that it is already loaded when it is called again. Reverts the following commits: 13f1401a6cf0266a3b0a91b173f976db2d4e50f3 8491740ca5361ba9df20e1c8b906c709f5bfbc12 dffbb521a0d00c8673a3ad6e0e8ff526f32daf4e Fixes #6575, #6576 & #6577 | ||||
* | Adds test to check that circular preloading does not modify Model.unscoped ↵ | Benedikt Deicke | 2012-04-19 | 1 | -0/+2 |
| | | | | | | | | (as described in #5667) Conflicts: activerecord/test/cases/associations/eager_test.rb | ||||
* | Add order to tests that rely on db ordering, to fix failing tests on pg | Carlos Antonio da Silva | 2012-03-22 | 1 | -1/+1 |
| | | | | | | | Also skip persistente tests related to UPDATE + ORDER BY for postgresql PostgreSQL does not support updates with order by, and these tests are failing randomly depending on the fixture loading order now. | ||||
* | Not need to pass join attributes to association build | Rafael Mendonça França | 2012-03-08 | 2 | -9/+9 |
| | |||||
* | Add test case to has_many through association when mass_assignment_sanitizer is | Rafael Mendonça França | 2012-03-08 | 3 | -0/+13 |
| | | | | | | | | :strict Conflicts: activerecord/test/models/person.rb | ||||
* | Fix broken tests added by 85c724d59 | Rafael Mendonça França | 2012-01-31 | 1 | -1/+1 |
| | |||||
* | Merge pull request #4783 from gregolsen/ids_reader_fix | Jon Leighton | 2012-01-31 | 1 | -0/+1 |
| | | | | ids_reader method fixed, test added to has_many association (for PostgreSQL) | ||||
* | Merge pull request #4487 from sarenji/fix-reset-counters | Aaron Patterson | 2012-01-17 | 2 | -0/+8 |
| | | | | Fix bug where reset_counters resets the wrong counter cache. | ||||
* | serialize fails on subclass | Alvaro Bautista | 2011-12-23 | 1 | -0/+4 |
| | |||||
* | added failing tests for has_many, has_one and belongs_to associations with ↵ | Jakub Kuźma | 2011-12-21 | 1 | -2/+2 |
| | | | | | | strict mass assignment sanitizer, fixed build_record to not merge creation_attributes, removed failing nested attributes tests (that feature was broken anyway) #4051 Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | call scope within unscoped to prevent duplication of where values | Sergey Nartimov | 2011-12-17 | 1 | -0/+2 |
| | |||||
* | Allow nested attributes in associations to update values in it's owner ↵ | Andrew Kaspick | 2011-12-14 | 1 | -1/+4 |
| | | | | object. Fixes a regression from 3.0.x | ||||
* | Fix #3890. (Calling proxy_association in scope chain.) | Jon Leighton | 2011-12-08 | 1 | -1/+5 |
| | |||||
* | Deprecate set_locking_column in favour of self.locking_column= | Jon Leighton | 2011-11-29 | 1 | -1/+1 |
| | |||||
* | Deprecate set_primary_key in favour of self.primary_key= | Jon Leighton | 2011-11-29 | 12 | -14/+14 |
| | |||||
* | Deprecate set_sequence_name in favour of self.sequence_name= | Jon Leighton | 2011-11-29 | 1 | -1/+1 |
| | |||||
* | Deprecate set_inheritance_column in favour of self.inheritance_column= | Jon Leighton | 2011-11-29 | 1 | -1/+2 |
| | |||||
* | Deprecate set_table_name in favour of self.table_name= or defining your own ↵ | Jon Leighton | 2011-11-29 | 3 | -5/+5 |
| | | | | method. | ||||
* | don't change class definition in test case | Josh Susser | 2011-11-29 | 1 | -0/+4 |
| | |||||
* | use GeneratedFeatureMethods module for associations | Josh Susser | 2011-11-27 | 1 | -1/+0 |
| | |||||
* | Allow the :class_name option for associations to take a symbol. | Jon Leighton | 2011-11-04 | 1 | -0/+1 |
| | | | | | This is to avoid confusing newbies, and to be consistent with the fact that other options like :foreign_key already allow a symbol or a string. | ||||
* | Tests gotta run in 1.8 too | Jeremy Kemper | 2011-10-13 | 1 | -2/+2 |
| | |||||
* | Added ActiveRecord::Base.store for declaring simple single-column key/value ↵ | David Heinemeier Hansson | 2011-10-13 | 1 | -0/+1 |
| | | | | stores [DHH] | ||||
* | Raise error when using write_attribute with a non-existent attribute. | Jon Leighton | 2011-09-13 | 1 | -6/+7 |
| | | | | | | | | | Previously we would just silently write the attribute. This can lead to subtle bugs (for example, see the change in AutosaveAssociation where a through association would wrongly gain an attribute. Also, ensuring that we never gain any new attributes after initialization will allow me to reduce our dependence on method_missing. | ||||
* | Make protected method public so we avoid method_missing. | Jon Leighton | 2011-09-13 | 1 | -4/+5 |
| | |||||
* | Ensure we are not comparing a string with a symbol in ↵ | Jon Leighton | 2011-09-06 | 1 | -1/+1 |
| | | | | HasManyAssociation#inverse_updates_counter_cache?. Fixes #2755, where a counter cache could be decremented twice as far as it was supposed to be. | ||||
* | We need to recorder here. Need to drop the order from default scope. | Arun Agrawal | 2011-09-05 | 1 | -0/+10 |
| | | | Fixes #2832 | ||||
* | The join_nodes must be passed to the JoinDependency initializer and ↵ | Jon Leighton | 2011-08-29 | 1 | -0/+2 |
| | | | | therefore counted by the alias tracker. This is because the association_joins are aliased on initialization and then the tables are cached, so it is no use to alias the join_nodes later. Fixes #2556. | ||||
* | Fix default scope thread safety. Thanks @thedarkone for reporting. | Jon Leighton | 2011-08-13 | 1 | -0/+9 |
| | |||||
* | use existing model for testing Base.create with #after_initialize | Gabriel Horner | 2011-07-24 | 2 | -9/+5 |
| | |||||
* | simplify and be more explicit about create and after_initialize tests | Gabriel Horner | 2011-07-24 | 1 | -6/+2 |
| | |||||
* | fix after_initialize edge case (close #2074 and close #2175) | Les Fletcher | 2011-07-24 | 1 | -0/+13 |
| | | | | fix behavior when after_initialize is defined and a block is passed to Base.create | ||||
* | Fix exception if old and new targets are both nil. Fixes #1471. | Jon Leighton | 2011-07-12 | 1 | -1/+4 |
| | |||||
* | Assign the association attributes to the associated record before the ↵ | Jon Leighton | 2011-06-30 | 1 | -2/+7 |
| | | | | before_initialize callback of the record runs. Fixes #1842. | ||||
* | Apply the default scope earlier when doing calculations. Fixes #1682. | Jon Leighton | 2011-06-23 | 1 | -0/+6 |
| | |||||
* | Pass mass-assignment options to nested models - closes #1673. | Andrew White | 2011-06-13 | 1 | -2/+6 |
| | |||||
* | Refactor tests to be less brittle | Jon Leighton | 2011-06-12 | 1 | -0/+12 |
| | |||||
* | Test added for namedscope target. | Arun Agrawal | 2011-06-03 | 2 | -1/+6 |
| | |||||
* | Failing test for aggregating on default_scope with select | Erik Fonselius | 2011-05-31 | 1 | -0/+5 |
| | |||||
* | Tests for issue #1360 | Farley Knight | 2011-05-31 | 1 | -0/+15 |
| |