Handle Rails adding methods to nil that it really shouldn't.

This commit is contained in:
Noah Kantrowitz 2011-11-01 17:45:00 -07:00
parent 3a4c5c75dc
commit ca4af48b7d

View File

@ -137,6 +137,8 @@ module Compass
def read_without_default(attribute) def read_without_default(attribute)
if set?(attribute) if set?(attribute)
send("raw_#{attribute}") send("raw_#{attribute}")
elsif inherited_data.nil?
nil
elsif inherited_data.respond_to?("#{attribute}_without_default") elsif inherited_data.respond_to?("#{attribute}_without_default")
inherited_data.send("#{attribute}_without_default") inherited_data.send("#{attribute}_without_default")
elsif inherited_data.respond_to?(attribute) elsif inherited_data.respond_to?(attribute)