lib/mongoid-preferences/preferences/preferenceable.rb in mongoid-preferences-0.0.2 vs lib/mongoid-preferences/preferences/preferenceable.rb in mongoid-preferences-0.0.3
- old
+ new
@@ -73,10 +73,10 @@
end
# Returns a hash of preferences merged from file and model
def merged_preferences
# get the preferences from model
- model_preferences_hash = self.read_attribute(:preferences)
+ model_preferences_hash = HashWithIndifferentAccess.new(self.read_attribute(:preferences))
# get the default preferences form file
default_preferences_hash = default_preferences
# merge the preferences
default_preferences_hash.each_key do |key|
default_preferences_hash[key][:preferences].each do |preference|
\ No newline at end of file