aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/nested_attributes.rb
Commit message (Collapse)AuthorAgeFilesLines
* let the object stay in charge of internal cache invalidationAaron Patterson2013-06-131-6/+1
|
* Getting rid of the +automatic_inverse_of: false+ option in associations in favorwangjohn2013-06-081-0/+4
| | | | | of using +inverse_of: false+ option. Changing the documentation and adding a CHANGELOG entry for the automatic inverse detection feature.
* Created a method to automatically find inverse associations and cachewangjohn2013-05-071-0/+5
| | | | | | the results. Added tests to check to make sure that inverse associations are automatically found when has_many, has_one, or belongs_to associations are defined.
* Do not overwrite manually built records during one-to-one nested attribute ↵Olek Janiszewski2013-05-031-7/+32
| | | | | | | | | | | | | | | | | | | | | assignment For one-to-one nested associations, if you build the new (in-memory) child object yourself before assignment, then the NestedAttributes module will not overwrite it, e.g.: class Member < ActiveRecord::Base has_one :avatar accepts_nested_attributes_for :avatar def avatar super || build_avatar(width: 200) end end member = Member.new member.avatar_attributes = {icon: 'sad'} member.avatar.width # => 200
* Added a bang to the end of +raise_nested_attributes_record_not_found+wangjohn2013-04-061-3/+3
| | | | method to signify an exception possibly being raised.
* Fix my typoAlexey Muranov2013-03-121-1/+1
|
* Align indentation in commentsAlexey Muranov2013-03-121-15/+15
|
* Document nested attributes as hash of hashesAlexey Muranov2013-03-121-2/+26
| | | Document the possibility to use a hash of hashes for nested attributes for a one-to-many association (in addition to the documented possibility to use an array of hashes).
* Refactored nested associations so they are more readable. Added commentswangjohn2013-03-081-26/+54
| | | | which make it clearer about what's going on.
* Change docs to use update instead of update_attributesAmparo Luna + Guillermo Iguaran2013-01-031-1/+1
|
* 1.9 Syntax related changesAvnerCohen2012-11-101-35/+35
|
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-11-031-3/+3
|\ | | | | | | | | | | | | Conflicts: actionpack/lib/action_controller/metal/mime_responds.rb activerecord/lib/active_record/attribute_methods.rb guides/source/working_with_javascript_in_rails.md
| * Fixed typo on ActiveRecord nested_attributes.Luis M2012-10-231-3/+3
| |
* | Remove ActiveRecord::ModelJon Leighton2012-10-261-6/+2
| | | | | | | | | | | | | | | | | | | | In the end I think the pain of implementing this seamlessly was not worth the gain provided. The intention was that it would allow plain ruby objects that might not live in your main application to be subclassed and have persistence mixed in. But I've decided that the benefit of doing that is not worth the amount of complexity that the implementation introduced.
* | Revert "Get rid of the ActiveRecord::Model::DeprecationProxy thing."Jeremy Kemper2012-10-201-1/+1
| | | | | | | | This reverts commit 83846838252397b3781eed165ca301e05db39293.
* | Get rid of the ActiveRecord::Model::DeprecationProxy thing.Jon Leighton2012-10-191-1/+1
|/ | | | | | | | | | | | | | | | | I think it's going to be too much pain to try to transition the :active_record load hook from executing against Base to executing against Model. For example, after Model is included in Base, and modules included in Model will no longer get added to the ancestors of Base. So plugins which wish to be compatible with both Model and Base should use the :active_record_model load hook which executes *before* Base gets loaded. In general, ActiveRecord::Model is an advanced feature at the moment and probably most people will continue to inherit from ActiveRecord::Base for the time being.
* Remove unused private method AR::NestedAttributes#unassignable_keys and ↵Guillermo Iguaran2012-09-191-5/+1
| | | | reference to mass_assignment options
* Remove mass_assignment_options from ActiveRecordGuillermo Iguaran2012-09-161-12/+10
|
* Remove mass assignment security from ActiveRecordGuillermo Iguaran2012-09-161-15/+1
|
* Refactor nested attributes limit logic to lookup :limit option only onceCarlos Antonio da Silva2012-09-081-11/+12
|
* allow to pass Symbol or Proc into :limit option of ↵Mikhail Dieterle2012-08-261-3/+13
| | | | #accepts_nested_attributes_for
* load active_support/core_ext/class/attribute in active_support/railsXavier Noria2012-08-021-1/+0
|
* load active_support/core_ext/object/blank in active_support/railsXavier Noria2012-08-021-1/+0
|
* s/scoped/scope/Jon Leighton2012-08-011-1/+1
|
* Made ArgumentError messages consistent.Philip Arndt2012-07-061-2/+2
|
* Simplify AR configuration code.Jon Leighton2012-06-151-1/+5
| | | | | Get rid of ActiveModel::Configuration, make better use of ActiveSupport::Concern + class_attribute, etc.
* better wordingHrvoje Šimić2012-05-111-4/+4
|
* Nested attribute setters can be overridden.Jonathan Mukai & Peter Jaros2012-03-281-1/+1
| | | | Overriding implementation can call super.
* Modified comments explaining what the update_only option does.Mark2012-02-281-8/+19
|
* Array.wrap is an overhead as there is already check for classSergey Nartimov2012-01-061-1/+1
|
* Support configuration on ActiveRecord::Model.Jon Leighton2011-12-281-1/+1
| | | | | | | | | | | | | | | The problem: We need to be able to specify configuration in a way that can be inherited to models that include ActiveRecord::Model. So it is no longer sufficient to put 'top level' config on ActiveRecord::Base, but we do want configuration specified on ActiveRecord::Base and descendants to continue to work. So we need something like class_attribute that can be defined on a module but that is inherited when ActiveRecord::Model is included. The solution: added ActiveModel::Configuration module which provides a config_attribute macro. It's a bit specific hence I am not putting this in Active Support or making it a 'public API' at present.
* Exclude _destroy parameter in :all_blank check (issue #2937)Aaron Christy2011-10-171-2/+3
|
* no need to sort the valuesAaron Patterson2011-07-201-1/+1
|
* assign_nested_attributes_for_collection_association should work with Ruby ↵Franck Verrot2011-07-201-1/+1
| | | | | | 1.9 [Closes #2106] Children attributes can be either String's or Symbol's, so let's check if the object responds to to_i.
* Use an instance variable to store the current masss assignment optionsAndrew White2011-07-041-4/+4
|
* Pass mass-assignment options to nested models - closes #1673.Andrew White2011-06-131-13/+19
|
* Remove dead branch code that appeared back in a merge.José Valim2011-04-101-6/+0
|
* Destroying records via nested attributes works independent of reject_if:Durran Jordan2011-04-051-0/+1
| | | | | | | | | | - When a :_destroy truthiness is provided in the attributes hash, the record should get destroyed regardless of the result of the proc or method supplied to :reject_if. (If :allow_destroy is true) [#6006 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Merge remote branch 'rails/master' into identity_mapEmilio Tagua2011-02-181-5/+5
|\ | | | | | | | | | | 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-5/+5
| | | | | | | | manages the association, and a CollectionProxy class which is *only* a proxy. Singular associations no longer have a proxy. See CHANGELOG for more.
* | Merge remote branch 'rails/master' into identity_mapEmilio Tagua2011-02-151-1/+13
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/examples/performance.rb activerecord/lib/active_record/association_preload.rb activerecord/lib/active_record/associations.rb activerecord/lib/active_record/associations/association_proxy.rb activerecord/lib/active_record/autosave_association.rb activerecord/lib/active_record/base.rb activerecord/lib/active_record/nested_attributes.rb activerecord/test/cases/relations_test.rb
| * Rename add_record_to_target_with_callbacks to add_to_targetJon Leighton2011-02-141-1/+1
| |
| * ActiveRecord::Relation#primary_key should return a string, just like ↵Jon Leighton2011-01-031-1/+1
| | | | | | | | ActiveRecord::Base.primary_key does.
| * Let AssociationCollection#find use #scoped to do its finding. Note that I am ↵Jon Leighton2011-01-031-1/+1
| | | | | | | | removing test_polymorphic_has_many_going_through_join_model_with_disabled_include, since this specifies different behaviour for an association than for a regular scope. It seems reasonable to expect scopes and association proxies to behave in roughly the same way rather than having subtle differences.
| * When a has_many association is not :uniq, appending the same record multiple ↵Jon Leighton2010-12-231-1/+12
| | | | | | | | times should append it to the @target multiple times [#5964 state:resolved]
* | Merge remote branch 'rails/master' into identity_mapEmilio Tagua2010-12-201-13/+13
|\| | | | | | | | | | | | | | | Conflicts: activerecord/lib/active_record/associations/association_proxy.rb activerecord/lib/active_record/autosave_association.rb activerecord/lib/active_record/base.rb activerecord/lib/active_record/persistence.rb
| * If a nested_attribute is being marked for destruction and at the same time ↵Neeraj Singh2010-11-241-5/+2
| | | | | | | | | | | | | | | | an attr_accessor value is being assigned then the value being assigned is being ignored. This patch is a fix for that issue. [#5939 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
| * Remove unneeded local var.Emilio Tagua2010-11-241-2/+1
| |
| * Remove uneeded local var definition.Emilio Tagua2010-11-241-2/+1
| |
| * class inheritable attributes is used no more! all internal use of class ↵Josh Kalderimis2010-11-201-4/+9
| | | | | | | | | | | | inheritable has been changed to class_attribute. class inheritable attributes has been deprecated. Signed-off-by: José Valim <jose.valim@gmail.com>