drop: only check mutable if the key is a method
This commit is contained in:
parent
62d7f5ecad
commit
95a3c54ddb
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue