drop: only check mutable if the key is a method

This commit is contained in:
Parker Moore 2016-01-04 12:41:40 -08:00
parent 62d7f5ecad
commit 95a3c54ddb
1 changed files with 5 additions and 3 deletions

View File

@ -64,10 +64,12 @@ module Jekyll
def []=(key, val) def []=(key, val)
if respond_to?("#{key}=") if respond_to?("#{key}=")
public_send("#{key}=", val) public_send("#{key}=", val)
elsif self.class.mutable
@mutations[key] = val
elsif respond_to? key elsif respond_to? key
raise Errors::DropMutationException, "Key #{key} cannot be set in the drop." if self.class.mutable
@mutations[key] = val
else
raise Errors::DropMutationException, "Key #{key} cannot be set in the drop."
end
else else
fallback_data[key] = val fallback_data[key] = val
end end