From 95a3c54ddb374a757cec468caed3d413dd2ea9e9 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Mon, 4 Jan 2016 12:41:40 -0800 Subject: [PATCH] drop: only check mutable if the key is a method --- lib/jekyll/drops/drop.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/jekyll/drops/drop.rb b/lib/jekyll/drops/drop.rb index af249996..b4a07fc7 100644 --- a/lib/jekyll/drops/drop.rb +++ b/lib/jekyll/drops/drop.rb @@ -64,10 +64,12 @@ module Jekyll def []=(key, val) if respond_to?("#{key}=") public_send("#{key}=", val) - elsif self.class.mutable - @mutations[key] = val 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 fallback_data[key] = val end