aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/association.rb
Commit message (Collapse)AuthorAgeFilesLines
...
| * fix inverse_of association in block of new childMichal Cichra2013-04-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes inconsistency when building children of association which has inverse_of set properly. When creating new association object with a block: parent.association.build do |child| child.parent.equal?(parent) # false end So the block the `child.parent` did not point to the same object. But when the object is created it points to same instance: child = parent.association.build child.parent.equal?(parent) # true
* | Merge branch 'master' of github.com:lifo/docrailsVijay Dev2013-03-301-1/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb activerecord/test/cases/adapter_test.rb guides/source/testing.md [ci skip]
| * | explain method invertible_for [ci skip]Neeraj Singh2013-03-291-1/+2
| | |
* | | Do not use deprecate method [ci skip]Neeraj Singh2013-03-291-1/+1
| | |
* | | fix broken sentence [ci skip]Neeraj Singh2013-03-291-1/+1
| |/ |/|
* | Adding a bang to method name of raise_on_type_mismatch.wangjohn2013-03-211-1/+1
|/
* No need to send public methodsAkira Matsuda2013-02-261-1/+1
|
* prevent mass assignment of polymorphic type when using `build`Yves Senn2012-11-221-1/+2
| | | | Closes #8265
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-11-031-1/+1
|\ | | | | | | | | | | | | Conflicts: actionpack/lib/action_controller/metal/mime_responds.rb activerecord/lib/active_record/attribute_methods.rb guides/source/working_with_javascript_in_rails.md
| * fix a typo in comments to ActiveRecord::Associations::Association.stale_stateAndrii Dovgaliuk2012-10-241-1/+1
| |
* | Make caller attribute in deprecation methods optionalAlexey Gaziev2012-10-301-1/+1
| |
* | Provide a call stack for deprecation warnings where needed.Nikita Afanasenko2012-10-291-1/+1
|/ | | | It's sometimes hard to quickly find where deprecated call was performed, especially in case of migrating between Rails versions. So this is an attempt to improve the call stack part of the warning message by providing caller explicitly.
* Fix destructive side effects from marshaling an association caused by ↵Jeremy Kemper2012-09-251-5/+2
| | | | 65843e1acc0c8d285ff79f8c9c49d4d1215440be
* Remove mass_assignment_options from ActiveRecordGuillermo Iguaran2012-09-161-3/+3
|
* removes usage of Object#in? from the code base (the method remains defined ↵Xavier Noria2012-08-061-1/+1
| | | | | | | | | | | | | | | | | | | by Active Support) Selecting which key extensions to include in active_support/rails made apparent the systematic usage of Object#in? in the code base. After some discussion in https://github.com/rails/rails/commit/5ea6b0df9a36d033f21b52049426257a4637028d we decided to remove it and use plain Ruby, which seems enough for this particular idiom. In this commit the refactor has been made case by case. Sometimes include? is the natural alternative, others a simple || is the way you actually spell the condition in your head, others a case statement seems more appropriate. I have chosen the one I liked the most in each case.
* load active_support/deprecation in active_support/railsXavier Noria2012-08-021-1/+0
|
* load active_support/core_ext/object/inclusion in active_support/railsXavier Noria2012-08-021-1/+0
|
* s/scoped/scope/Jon Leighton2012-08-011-1/+7
|
* Revert "Remove :finder_sql, :counter_sql, :insert_sql, :delete_sql."Jon Leighton2012-08-011-0/+8
| | | | | | | | | This reverts commit 3803fcce26b837c0117f7d278b83c366dc4ed370. Conflicts: activerecord/CHANGELOG.md It will be deprecated only in 4.0, and removed properly in 4.1.
* Deprecate ActiveRecord::Base.scoped.Jon Leighton2012-07-271-1/+1
| | | | | | | It doesn't serve much purpose now that ActiveRecord::Base.all returns a Relation. The code is moved to active_record_deprecated_finders.
* Remove :finder_sql, :counter_sql, :insert_sql, :delete_sql.Jon Leighton2012-07-201-8/+0
|
* Represent association scope options as AR::Relations insternally.Jon Leighton2012-07-131-5/+16
|
* Allow associations to take a lambda which builds the scopeJon Leighton2012-07-131-1/+5
|
* Fix #5563. Should reflect the most recent change to either of association / id.kennyj2012-04-131-1/+2
|
* Some refactor for association.kennyj2012-04-121-7/+1
| | | | | | | * 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.kennyj2012-04-041-1/+1
|
* Remove IdentityMapCarlos Antonio da Silva2012-03-131-12/+1
|
* Fix #5069 - Protect foreign key from mass assignment throught association ↵Jean Boussier2012-03-051-1/+2
| | | | builder
* Initialize @stale_state to nil in associationCarlos Antonio da Silva2012-03-041-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.
* added failing tests for has_many, has_one and belongs_to associations with ↵Jakub Kuźma2011-12-211-6/+1
| | | | strict mass assignment sanitizer, fixed build_record to not merge creation_attributes, removed failing nested attributes tests (that feature was broken anyway) #4051
* Allow nested attributes in associations to update values in it's owner ↵Andrew Kaspick2011-12-141-0/+2
| | | | object. Fixes a regression from 3.0.x
* Fix private methods which are delegated to. This previously worked because ↵Jon Leighton2011-08-151-8/+8
| | | | Module#delegate previously ignored method visibility.
* Don't construct association scope in initializer. This yields a big ↵Jon Leighton2011-07-071-6/+10
| | | | performance gain for cases where the association is never used to load the target, for example with preloading. Related: #1873.
* Assign the association attributes to the associated record before the ↵Jon Leighton2011-06-301-0/+9
| | | | before_initialize callback of the record runs. Fixes #1842.
* Allow polymorphic has_one to work when the association is set before the ↵Jon Leighton2011-06-081-3/+1
| | | | owner has been saved. Fixes #1524.
* When you add a record to a polymorphic has_one, you should be able to access ↵Jon Leighton2011-06-081-1/+1
| | | | the owner from the associated record
* Remove `#among?` from Active SupportPrem Sichanugrist2011-04-131-1/+1
| | | | | | 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?`.
* Change Object#either? to Object#among? -- thanks to @jamesarosen for the ↵David Heinemeier Hansson2011-04-121-1/+1
| | | | suggestion!
* Using Object#in? and Object#either? in various placesPrem Sichanugrist2011-04-111-1/+2
| | | | 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?.
* Move the code which builds a scope for through associations into a generic ↵Jon Leighton2011-03-101-38/+6
| | | | AssociationScope class which is capable of building a scope for any association.
* Active Record typos.R.T. Lechow2011-03-051-2/+2
|
* Fix a couple of tests in join_model_test.rb which were failing when the ↵Jon Leighton2011-03-041-2/+2
| | | | identity map is turned off
* Rename target_klass to klassJon Leighton2011-02-211-7/+7
|
* Delegate Association#options to the reflection, and replace ↵Jon Leighton2011-02-211-6/+6
| | | | 'reflection.options' with 'options'. Also add through_options and source_options methods for through associations.
* Associations - where possible, call attributes methods rather than directly ↵Jon Leighton2011-02-211-23/+23
| | | | accessing the instance variables
* Initialize @target instead asking if it is defined.Emilio Tagua2011-02-181-1/+2
|
* Reindent and remove wrong line left in merge by mistake.Emilio Tagua2011-02-181-4/+3
|
* Merge remote branch 'rails/master' into identity_mapEmilio Tagua2011-02-181-0/+16
| | | | | | Conflicts: activerecord/lib/active_record/associations/association.rb activerecord/lib/active_record/fixtures.rb
* Split AssociationProxy into an Association class (and subclasses) which ↵Jon Leighton2011-02-181-0/+246
manages the association, and a CollectionProxy class which is *only* a proxy. Singular associations no longer have a proxy. See CHANGELOG for more.