Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Fix uninitialized warning with @new_record instance variable | Andrew White | 2016-11-03 | 1 | -0/+1 |
| | | | | | Initializing @stale_state to nil when an association is built fixes a marshalling error - see #5268 for more details. | ||||
* | Associations do not call `.to_proc` on Hash | Tyler Distad | 2016-05-16 | 1 | -1/+1 |
| | | | | Fixes #25010 | ||||
* | Revert "Merge pull request #12413 from arthurnn/inverse_of_on_build" | Rafael Mendonça França | 2013-10-10 | 1 | -1/+0 |
| | | | | | | | | | This reverts commit ccd11d58910059f07b28cc518dbdad42cbc8ea0c, reversing changes made to 54c05acdba138f3a7a3d44dfc922b0fe4e4cf554. Reason: This caused a regression when the associated record is created in a before_create callback. See https://github.com/rails/rails/pull/12413#issuecomment-25848163 | ||||
* | Move set_inverse_instance to association.build_record | Arthur Neves | 2013-09-30 | 1 | -0/+1 |
| | | | | [fixes #10371] | ||||
* | @target might be nil when Identity Map is enabled. | Larry Lv | 2013-03-08 | 1 | -3/+8 |
| | | | | | | | * With Identity Map enabled, NameError might be raised and @target is nil. So we should always ensure `@target ||= find_target`. * Only force reload target when it is stale. | ||||
* | Fix issue #7526. Reload the target if it's stale. | larrylv | 2013-03-05 | 1 | -3/+4 |
| | | | | | | | | * This has been fixed at master via `365b8b6`, but not at 3-2-stable branch. * @stale_state should be nil when a model isn't saved. via `0f3901e`. * set @stale_state to nil when reset the target. | ||||
* | backport #8291, prevent mass assignment of polymorphic type with `build` | Yves Senn | 2012-11-22 | 1 | -1/+2 |
| | | | | | | | | | Closes #8265 Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/associations/association.rb | ||||
* | Fix #5069 - Protect foreign key from mass assignment throught association ↵ | Jean Boussier | 2012-03-05 | 1 | -1/+2 |
| | | | | builder | ||||
* | added failing tests for has_many, has_one and belongs_to associations with ↵ | Jakub Kuźma | 2011-12-21 | 1 | -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 Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | Allow nested attributes in associations to update values in it's owner ↵ | Andrew Kaspick | 2011-12-14 | 1 | -0/+2 |
| | | | | object. Fixes a regression from 3.0.x | ||||
* | Fix private methods which are delegated to. This previously worked because ↵ | Jon Leighton | 2011-08-15 | 1 | -8/+8 |
| | | | | Module#delegate previously ignored method visibility. | ||||
* | Don't construct association scope in initializer. This yields a big ↵ | Jon Leighton | 2011-07-07 | 1 | -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 Leighton | 2011-06-30 | 1 | -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 Leighton | 2011-06-08 | 1 | -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 Leighton | 2011-06-08 | 1 | -1/+1 |
| | | | | the owner from the associated record | ||||
* | Remove `#among?` from Active Support | Prem Sichanugrist | 2011-04-13 | 1 | -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 Hansson | 2011-04-12 | 1 | -1/+1 |
| | | | | suggestion! | ||||
* | Using Object#in? and Object#either? in various places | Prem Sichanugrist | 2011-04-11 | 1 | -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 Leighton | 2011-03-10 | 1 | -38/+6 |
| | | | | AssociationScope class which is capable of building a scope for any association. | ||||
* | Active Record typos. | R.T. Lechow | 2011-03-05 | 1 | -2/+2 |
| | |||||
* | 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 | ||||
* | Rename target_klass to klass | Jon Leighton | 2011-02-21 | 1 | -7/+7 |
| | |||||
* | Delegate Association#options to the reflection, and replace ↵ | Jon Leighton | 2011-02-21 | 1 | -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 Leighton | 2011-02-21 | 1 | -23/+23 |
| | | | | accessing the instance variables | ||||
* | Initialize @target instead asking if it is defined. | Emilio Tagua | 2011-02-18 | 1 | -1/+2 |
| | |||||
* | Reindent and remove wrong line left in merge by mistake. | Emilio Tagua | 2011-02-18 | 1 | -4/+3 |
| | |||||
* | Merge remote branch 'rails/master' into identity_map | Emilio Tagua | 2011-02-18 | 1 | -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 Leighton | 2011-02-18 | 1 | -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. |