Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adjust to PropertySet not being an Array anymore.

  • Loading branch information...
commit 35ee0c26e5c56e6bfae15ba13d933509565a7f48 1 parent f94e78d
@gix gix authored
View
6 lib/dm-accepts_nested_attributes/relationship.rb
@@ -38,7 +38,7 @@ module OneToMany
def extract_keys_for_nested_attributes(model, attributes)
keys = self.child_model.key.to_enum(:each_with_index).map do |key, idx|
if parent_idx = self.child_key.to_a.index(key)
- model[self.parent_key.at(parent_idx).name]
+ model[self.parent_key.to_a.at(parent_idx).name]
else
attributes[key.name]
end
@@ -53,7 +53,7 @@ module ManyToOne
def extract_keys_for_nested_attributes(model, attributes)
keys = self.parent_model.key.to_enum(:each_with_index).map do |key, idx|
if child_idx = self.parent_key.to_a.index(key)
- model[self.child_key.at(child_idx).name]
+ model[self.child_key.to_a.at(child_idx).name]
else
attributes[key.name]
end
@@ -68,7 +68,7 @@ module OneToOne
def extract_keys_for_nested_attributes(model, attributes)
keys = self.child_model.key.to_enum(:each_with_index).map do |key, idx|
if parent_idx = self.child_key.to_a.index(key)
- model[self.parent_key.at(parent_idx).name]
+ model[self.parent_key.to_a.at(parent_idx).name]
else
attributes[key.name]
end
View
2  lib/dm-accepts_nested_attributes/resource.rb
@@ -52,7 +52,7 @@ def save(*)
# The model key and :_delete, the latter being a special value
# used to mark a resource for destruction
def unassignable_keys
- model.key.to_a << :_delete
+ model.key.to_a.dup << :_delete
end

1 comment on commit 35ee0c2

@solnic

see...I told you that change is gonna break some code...!

Please sign in to comment.
Something went wrong with that request. Please try again.