Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | | AliasTracker.pluralize use pluralize_table_names of model | Guillermo Iguaran | 2011-05-20 | 2 | -3/+3 | |
| | | ||||||
* | | Implement proxy_owner, proxy_target and proxy_reflection methods on ↵ | Jon Leighton | 2011-05-19 | 1 | -0/+24 | |
|/ | | | | CollectionProxy with deprecations. Fixes #1148. | |||||
* | Don't pass a block as we are yielding | Andrew White | 2011-05-17 | 1 | -1/+1 | |
| | ||||||
* | Add block setting of attributes to singular associations | Andrew White | 2011-05-17 | 2 | -11/+12 | |
| | ||||||
* | Pass the attribute and option hashes to build_association | Andrew White | 2011-05-17 | 2 | -8/+12 | |
| | | | | | | | The build_association method was added as an API for plugins to hook into in 1398db0. This commit restores this API and the ability to override class.new to return a subclass based on a virtual attribute in the attributes hash. | |||||
* | Merge pull request #560 from guilleiguaran/fix_pluralize_table_names_false | Jon Leighton | 2011-05-16 | 1 | -1/+1 | |
|\ | | | | | Fixing has_many when ActiveRecord::Base.pluralize_table_names is false | |||||
| * | Fixing has_many association when ActiveRecord::Base.pluralize_table_names is ↵ | Guillermo Iguaran | 2011-05-15 | 1 | -1/+1 | |
| | | | | | | | | false. fixes #557 | |||||
* | | These extra array operations appear to be unnecessary. Reasoning: | Jon Leighton | 2011-05-14 | 1 | -8/+2 | |
| | | | | | | | | | | * It is not necessary to subtract 'id' from the list of copied attributes because record and mem_record are equal, so therefore their id attributes are also equal (so there is no harm in copying it, and this reduces the complexity of the code) * It is not necessary to intersect the attribute names, since record and mem_record are equal, so they have the same id and class, so they have the same columns in the database. If record has non-column attributes then it seems reasonable to also copy them onto mem_record (though I am not sure what situation this would ever happen in) | |||||
* | | CollectionAssociation#merge_target_lists should write to the underlying ↵ | Jon Leighton | 2011-05-14 | 1 | -5/+2 | |
| | | | | | | | | attributes when copying, rather than using the assignment method | |||||
* | | An attempt to make CollectionAssociation#merge_target_lists make more sense. | Jon Leighton | 2011-05-14 | 1 | -16/+35 | |
|/ | ||||||
* | Instead of doing find(:all) which does scoped.find(:all) which does ↵ | Jon Leighton | 2011-05-13 | 1 | -1/+1 | |
| | | | | scoped.all, just do scoped.all. | |||||
* | Remove pointless rescue (it doesn't happen anywhere in the tests, and I ↵ | Jon Leighton | 2011-05-13 | 1 | -9/+1 | |
| | | | | can't see a way that it would happen ever) | |||||
* | Don't use mass-assignment protection when setting foreign keys or ↵ | Jon Leighton | 2011-05-12 | 1 | -9/+9 | |
| | | | | association conditions on singular associations. Fixes #481 (again). | |||||
* | Don't remove the target if it has already been destroyed | Andrew White | 2011-05-11 | 1 | -1/+1 | |
| | ||||||
* | Modified CollectionAssociation to refer to the new class name. | Michael Ebens | 2011-05-11 | 1 | -1/+1 | |
| | ||||||
* | Don't use select() values from the join model of a through association. ↵ | Jon Leighton | 2011-05-11 | 1 | -3/+4 | |
| | | | | Fixes #508. | |||||
* | Bring back obj.association_loaded? as a deprecated method. Fixes #472. | Jon Leighton | 2011-05-11 | 1 | -0/+13 | |
| | ||||||
* | Remove unnecessary '|| {}' | Jon Leighton | 2011-05-10 | 1 | -1/+1 | |
| | ||||||
* | Don't use mass-assignment protection when applying the ↵ | Jon Leighton | 2011-05-10 | 2 | -3/+7 | |
| | | | | scoped.scope_for_create. Fixes #481. | |||||
* | Fix #480. Passing nil to create association works. | José Valim | 2011-05-10 | 1 | -1/+1 | |
| | ||||||
* | Revert "b9ea751d0e56bd00d341766977a607ed3f7ddd0f". | José Valim | 2011-05-10 | 1 | -26/+27 | |
| | | | | | Wrapping each Record.associations.build in a transaction is going to make several unneeded queries. Reverting this commit also fixes #479. | |||||
* | Merge pull request #399 from ernie/join_conditions_on_join | Jon Leighton | 2011-05-05 | 1 | -3/+3 | |
|\ | | | | | Add association join conditions to JOIN clause, not WHERE | |||||
| * | Add join conditions to JOIN clause, not WHERE | Ernie Miller | 2011-05-05 | 1 | -3/+3 | |
| | | ||||||
* | | Merge pull request #358 from baroquebobcat/fix_find_or_create_master | Aaron Patterson | 2011-05-05 | 1 | -3/+6 | |
|\ \ | |/ |/| | Fix for lighthouse #6741 | |||||
| * | Fix for lighthouse #6741 | Nick Howard | 2011-05-01 | 1 | -3/+6 | |
| | | | | | | | | | | | | | | - adds tests for find_or_create_by and find_or_initialize_by on has_many associations - changes the behavior of ActiveRecord::Associations::CollectionProxy#method_missing to differ to ActiveRecord::FinderMethods#find_or_instantiator_by_attributes for arg processing and saving so find_or_create_by's api on associations will be consistent w/ the api for model classes. | |||||
* | | singular and collection relations in AR can now specify mass-assignment ↵ | Josh Kalderimis | 2011-05-01 | 3 | -20/+20 | |
|/ | | | | security options (:as and :without_protection) in build, create and create! methods. | |||||
* | Extract the constraint-building for joins in JoinAssociation into a separate ↵ | Jon Leighton | 2011-04-14 | 1 | -8/+14 | |
| | | | | method to make it easy to change/override (requested by Ernie Miller so that MetaWhere can add to it easily) | |||||
* | Remove `#among?` from Active Support | Prem Sichanugrist | 2011-04-13 | 5 | -5/+5 | |
| | | | | | | After a long list of discussion about the performance problem from using varargs and the reason that we can't find a great pair for it, it would be best to remove support for it for now. It will come back if we can find a good pair for it. For now, Bon Voyage, `#among?`. | |||||
* | Removing the scope-caching which happens on association proxies, because the ↵ | Jon Leighton | 2011-04-12 | 2 | -14/+0 | |
| | | | | query is already cached by the query cacher. For formalised proof see http://www.youtube.com/watch?v=wDefXLb-FDs | |||||
* | Change Object#either? to Object#among? -- thanks to @jamesarosen for the ↵ | David Heinemeier Hansson | 2011-04-12 | 5 | -5/+5 | |
| | | | | suggestion! | |||||
* | Using Object#in? and Object#either? in various places | Prem Sichanugrist | 2011-04-11 | 5 | -5/+14 | |
| | | | | There're a lot of places in Rails source code which make a lot of sense to switching to Object#in? or Object#either? instead of using [].include?. | |||||
* | TableAlias leg ordering has changed, so change accordingly | Aaron Patterson | 2011-03-30 | 1 | -1/+1 | |
| | ||||||
* | Make clearing of HABTM join table contents happen in an after_destory callback. | Murray Steele | 2011-03-23 | 1 | -12/+12 | |
| | | | | The old method of redefining destroy meant that clearing the HABTM join table would happen as long as the call to destroy succeeded. Which meant if there was a before_destroy that stopped the instance being destroyed using normal means (returning false, raising ActiveRecord::Rollback) rather than exceptional means the join table would be cleared even though the instance wasn't destroyed. Doing it in an after_destroy hook avoids this and has the advantage of happening inside the DB transaction too. | |||||
* | Merge branch 'master' into nested_has_many_through | Jon Leighton | 2011-03-16 | 1 | -1/+1 | |
|\ | ||||||
| * | Add additional text to NotImplementedErrors [#6328 state:resolved] | Mike Gehard | 2011-03-12 | 1 | -1/+1 | |
| | | | | | | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com> | |||||
* | | Fix tests under postgres - we should always put conditions in the WHERE part ↵ | Jon Leighton | 2011-03-12 | 3 | -18/+22 | |
| | | | | | | | | not in ON constraints because postgres requires that the table has been joined before the condition references it. | |||||
* | | Resolve some TODO comments which I decided did not need anything done | Jon Leighton | 2011-03-12 | 2 | -8/+5 | |
| | | ||||||
* | | Abstract some common code from AssociationScope and ↵ | Jon Leighton | 2011-03-11 | 3 | -97/+82 | |
| | | | | | | | | JoinDependency::JoinAssociation into a JoinHelper module | |||||
* | | Refactor JoinAssociation | Jon Leighton | 2011-03-10 | 1 | -100/+54 | |
| | | ||||||
* | | Rename Reflection#through_reflection_chain and #through_options to ↵ | Jon Leighton | 2011-03-10 | 3 | -18/+15 | |
| | | | | | | | | Reflection#chain and Reflection#options as they now no longer relate solely to through associations. | |||||
* | | Move the code which builds a scope for through associations into a generic ↵ | Jon Leighton | 2011-03-10 | 7 | -209/+155 | |
| | | | | | | | | AssociationScope class which is capable of building a scope for any association. | |||||
* | | Fix ↵ | Jon Leighton | 2011-03-07 | 1 | -1/+1 | |
| | | | | | | | | test_has_many_association_through_a_has_many_association_with_nonstandard_primary_keys | |||||
* | | Refactor ThroughAssociation#join_to to be much smaller, and independent of ↵ | Jon Leighton | 2011-03-06 | 1 | -84/+28 | |
| | | | | | | | | construct_owner_conditions. | |||||
* | | Refactor ThroughAssociation#tables to just be a flat array of tables in the ↵ | Jon Leighton | 2011-03-06 | 1 | -75/+70 | |
| | | | | | | | | order that they should be joined together. | |||||
* | | Merge branch 'master' into nested_has_many_through | Jon Leighton | 2011-03-05 | 1 | -2/+2 | |
|\| | | | | | | | | | Conflicts: activerecord/CHANGELOG | |||||
| * | Active Record typos. | R.T. Lechow | 2011-03-05 | 1 | -2/+2 | |
| | | ||||||
| * | When preloading has_and_belongs_to_many associations, we should only ↵ | Jon Leighton | 2011-03-04 | 1 | -2/+4 | |
| | | | | | | | | instantiate one AR object per actual record in the database. (Even when IM is off.) | |||||
| * | Fix a couple of tests in join_model_test.rb which were failing when the ↵ | Jon Leighton | 2011-03-04 | 1 | -2/+2 | |
| | | | | | | | | identity map is turned off | |||||
* | | Use Base#type_condition in JoinAssociation | Jon Leighton | 2011-03-05 | 1 | -15/+4 | |
| | | ||||||
* | | Push source_type and polymorphic conditions out of ThroughAssociation and ↵ | Jon Leighton | 2011-03-05 | 2 | -35/+0 | |
| | | | | | | | | JoinDependency::JoinAssociation and into the reflection instead. |