Skip to content

Commit

Permalink
Using |attribute_name, attribute_value| instead of |k,v|.
Browse files Browse the repository at this point in the history
  • Loading branch information
tapajos committed Oct 31, 2009
1 parent 0ed7413 commit 1315d65
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/couchrest/more/extended_document.rb
Expand Up @@ -277,16 +277,16 @@ def mark_as_saved
private

def check_properties_exist(attrs)
attrs.each do |k, v|
raise NoMethodError, "#{k}= method not available, use property :#{k}" unless self.respond_to?("#{k}=")
attrs.each do |attribute_name, attribute_value|
raise NoMethodError, "#{attribute_name}= method not available, use property :#{attribute_name}" unless self.respond_to?("#{attribute_name}=")
end
end

def set_attributes(hash)
attrs = remove_protected_attributes(hash)
attrs.each do |k,v|
if self.respond_to?("#{k}=")
self.send("#{k}=", attrs.delete(k))
attrs.each do |attribute_name, attribute_value|
if self.respond_to?("#{attribute_name}=")
self.send("#{attribute_name}=", attrs.delete(attribute_name))
end
end
end
Expand Down

0 comments on commit 1315d65

Please sign in to comment.