Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | | Merge pull request #5453 from ↵ | Aaron Patterson | 2012-05-16 | 1 | -2/+6 | |
|\ \ | | | | | | | | | | | | | JonRowe/patch_uniq_has_and_belongs_to_many_when_already_loaded When Active Record has already loaded a unique association `.size` returns the wrong number. | |||||
| * | | when using a preloaded array and the uniq flag is set then return the size ↵ | Jon Rowe | 2012-03-15 | 1 | -2/+6 | |
| | | | | | | | | | | | | of the uniq array | |||||
* | | | Fix CollectionAssociation#replace to return new target (closes #6231) | Piotr Sarnacki | 2012-05-16 | 1 | -0/+2 | |
| | | | ||||||
* | | | Remove #=== quirk | Jon Leighton | 2012-05-11 | 1 | -6/+0 | |
| | | | | | | | | | | | | Makes it consistent with Relation. Can't see a use for this. | |||||
* | | | this stuff can all be handled by Relation | Jon Leighton | 2012-05-11 | 1 | -38/+0 | |
| | | | ||||||
* | | | extract deprecated code | Jon Leighton | 2012-05-11 | 1 | -8/+1 | |
| | | | ||||||
* | | | set_owner_attributes is covered by the scoping | Jon Leighton | 2012-05-11 | 1 | -4/+3 | |
| | | | ||||||
* | | | CollectionProxy < Relation | Jon Leighton | 2012-05-11 | 2 | -22/+23 | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This helps bring the interfaces of CollectionProxy and Relation closer together, and reduces the delegation backflips we need to perform. For example, first_or_create is defined thus: class ActiveRecord::Relation def first_or_create(...) first || create(...) end end If CollectionProxy < Relation, then post.comments.first_or_create will hit the association's #create method which will actually add the new record to the association, just as post.comments.create would. With the previous delegation, post.comments.first_or_create expands to post.comments.scoped.first_or_create, where post.comments.scoped has no knowledge of the association. | |||||
* | | | Revert "Merge pull request #5494 from ↵ | Jon Leighton | 2012-05-05 | 2 | -7/+2 | |
| | | | | | | | | | | | | | | | | | | | | | armstrjare/active_record_relation_keep_association_join_context_on_merge" This reverts commit dcd04e76179611a9db28c9e391aa7d6c2a5b046a, reversing changes made to 58a49875df63729f07a9a81d1ee349087d258df5. | |||||
* | | | Merge pull request #5494 from ↵ | Jon Leighton | 2012-05-05 | 2 | -2/+7 | |
|\ \ \ | | | | | | | | | | | | | | | | | armstrjare/active_record_relation_keep_association_join_context_on_merge ActiveRecord::Relation - maintain context of joined associations on merges | |||||
| * | | | Allow ActiveRecord::Relation merges to maintain context of joined associations | Jared Armstrong | 2012-05-04 | 2 | -2/+7 | |
| | | | | ||||||
* | | | | extract code from AR::Base | Jon Leighton | 2012-05-04 | 1 | -1/+1 | |
| | | | | ||||||
* | | | | clean up implementation of dynamic methods. use method compilation etc. | Jon Leighton | 2012-05-04 | 1 | -3/+3 | |
|/ / / | ||||||
* | | | Fix issue with private kernel methods and collection associations. Closes #2508 | Carlos Antonio da Silva | 2012-05-02 | 1 | -2/+2 | |
| | | | | | | | | | | | | | | | | | | | | | | | | Change CollectionProxy#method_missing to use scoped.public_send, to avoid a problem described in issue #2508 when trying to use class methods with names like "open", that clash with private kernel methods. Also changed the dynamic matcher instantiator to send straight to scoped, to avoid another roundtrip to method_missing. | |||||
* | | | allow AssociationProxy#scoped to take options so that API is the same as ↵ | Jon Leighton | 2012-04-27 | 1 | -2/+6 | |
| | | | | | | | | | | | | Base#scoped | |||||
* | | | Merge remote-tracking branch 'jmbejar/define_array_methods_collection_proxy' | Jon Leighton | 2012-04-25 | 1 | -0/+13 | |
|\ \ \ | ||||||
| * | | | Define array methods in ActiveRecord::Associations::CollectionProxy | Jorge Bejar | 2012-04-18 | 1 | -0/+13 | |
| | | | | | | | | | | | | | | | | | | | | | | | | if they are not defined or delegated. In this way, we have a performance boost invoking some array methods which are not defined in CollectionAssociation. | |||||
* | | | | Merge remote-tracking branch 'kennyj/fix_5563' | Jon Leighton | 2012-04-25 | 4 | -4/+6 | |
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/test/cases/associations/belongs_to_associations_test.rb | |||||
| * | | | | Fix #5563. Should reflect the most recent change to either of association / id. | kennyj | 2012-04-13 | 1 | -1/+2 | |
| | | | | | ||||||
| * | | | | @stale_state should be nil when a model isn't saved. | kennyj | 2012-04-13 | 3 | -3/+4 | |
| | | | | | ||||||
* | | | | | remove apply_finder_options call from AssociationScope | Jon Leighton | 2012-04-13 | 1 | -7/+8 | |
|/ / / / | ||||||
* | | | | Some refactor for association. | kennyj | 2012-04-12 | 3 | -8/+7 | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove unused association_class method. * Remove a unnecessary assignment. * Move @updated to BelongsToAssociation that only reference this instance variable. * Reset @stale_state at the reset method. I think this place is right place. | |||||
* | | | | Get a properly aliased_table_name, when we use a polymorphic association. | kennyj | 2012-04-04 | 1 | -1/+1 | |
|/ / / | ||||||
* / / | Fix #5667. Preloading should ignore scoping. | Jon Leighton | 2012-03-30 | 1 | -2/+3 | |
|/ / | ||||||
* | | Remove IdentityMap | Carlos Antonio da Silva | 2012-03-13 | 1 | -12/+1 | |
| | | ||||||
* | | In AR depths use &:to_i before :uniq to process mixed arrays likes ["1", 1] ↵ | Alexey Vakhov | 2012-03-09 | 1 | -1/+1 | |
| | | | | | | | | correct | |||||
* | | Not need to pass join attributes to association build | Rafael Mendonça França | 2012-03-07 | 2 | -4/+10 | |
| | | ||||||
* | | Fix #5069 - Protect foreign key from mass assignment throught association ↵ | Jean Boussier | 2012-03-05 | 1 | -1/+2 | |
| | | | | | | | | builder | |||||
* | | Initialize @stale_state to nil in association | Carlos Antonio da Silva | 2012-03-04 | 1 | -0/+1 | |
| | | | | | | | | | | | | | | | | | | | | | | | | | | This apparently fix the warning related to @new_record variable not being initialized in AR's test suit, when an association is built and the object is marshalled/loaded. See these tests in AR's base_test.rb: test_marshalling_with_associations test_marshalling_new_record_round_trip_with_associations Closes #3720. | |||||
* | | Revert "only mutate the scope object in the `bind` method" | Aaron Patterson | 2012-02-27 | 1 | -1/+1 | |
| | | | | | | | | This reverts commit 1b9e19cd22f2b5d5e7b82e042f92340822c0f966. | |||||
* | | only mutate the scope object in the `bind` method | Aaron Patterson | 2012-02-27 | 1 | -1/+1 | |
| | | ||||||
* | | bind value creation refactoring | Aaron Patterson | 2012-02-27 | 1 | -4/+10 | |
| | | ||||||
* | | removing dead code | Aaron Patterson | 2012-02-27 | 1 | -3/+2 | |
| | | ||||||
* | | use bind values for join columns | Aaron Patterson | 2012-02-27 | 1 | -1/+16 | |
| | | ||||||
* | | fix associations when using per class databases | Lars Kanis | 2012-02-10 | 3 | -8/+5 | |
| | | | | | | | | | | | | would get ConnectionNotEstablished error because it always tried to use ActiveRecord::Base's connection, even though it should be using the connection of the model whose context we're operating in | |||||
* | | Merge pull request #4543 from jdelStrother/find_or_init | Jon Leighton | 2012-02-01 | 1 | -2/+1 | |
|\ \ | |/ |/| | Don't instantiate two objects in collection proxy / find_or_instantiate_by | |||||
| * | Don't instantiate two objects in collection proxy / find_or_instantiator_by | Jonathan del Strother | 2012-01-19 | 1 | -2/+1 | |
| | | ||||||
* | | Use human attribute name to show the dependent destroy message | Rafael Mendonça França | 2012-02-01 | 1 | -1/+2 | |
| | | ||||||
* | | fix has_one, has_many restrict error message | Manoj | 2012-02-01 | 1 | -1/+2 | |
| | | ||||||
* | | Merge pull request #4799 from arunagw/warning_fixed_for_indentations | Aaron Patterson | 2012-01-31 | 1 | -1/+1 | |
|\ \ | | | | | | | warning removed: mismatched indentations | |||||
| * | | warning removed: mismatched indentations | Arun Agrawal | 2012-01-31 | 1 | -1/+1 | |
| | | | ||||||
* | | | Put spaces between the words at deprecation warning | Rafael Mendonça França | 2012-01-31 | 1 | -3/+3 | |
|/ / | ||||||
* | | Merge pull request #4783 from gregolsen/ids_reader_fix | Jon Leighton | 2012-01-31 | 1 | -1/+1 | |
|\ \ | | | | | | | ids_reader method fixed, test added to has_many association (for PostgreSQL) | |||||
| * | | ids_reader method fixed, test added to has_many association | gregolsen | 2012-01-31 | 1 | -1/+1 | |
| |/ | ||||||
* | | suggested fixes for :dependent => :restrict deprecation. | Manoj | 2012-01-31 | 1 | -1/+1 | |
| | | ||||||
* | | Same method for has_many and has_one associations | Paco Guzman | 2012-01-31 | 3 | -30/+17 | |
| | | ||||||
* | | Easy dependent_restrict error message | Paco Guzman | 2012-01-31 | 2 | -4/+2 | |
| | | ||||||
* | | has_many/has_one, :dependent => :restrict, deprecation added. | Manoj | 2012-01-29 | 3 | -3/+35 | |
|/ | ||||||
* | Deprecate inferred JOINs with includes + SQL snippets. | Jon Leighton | 2012-01-16 | 2 | -2/+2 | |
| | | | | | | See the CHANGELOG for details. Fixes #950. | |||||
* | Avoid sanitize_sql when we can use Relation#where instead | Jon Leighton | 2012-01-16 | 4 | -22/+16 | |
| |