lib/varia_model.rb in varia_model-0.5.0 vs lib/varia_model.rb in varia_model-0.6.0
- old
+ new
@@ -212,11 +212,11 @@
# @param [#to_s] key
#
# @return [Object]
def get_attribute(key)
- eval_as_proc(_attributes_.dig(key.to_s))
+ eval_as_proc(_attributes_.berks_dig(key.to_s))
end
alias_method :[], :get_attribute
# @param [#to_s] key
# @param [Object] value
@@ -292,10 +292,10 @@
_attributes_.deep_merge!(new_attrs)
end
def whitelist_assign(new_attrs = {})
self.class.attributes.dotted_paths.each do |dotted_path|
- value = new_attrs.dig(dotted_path)
+ value = new_attrs.berks_dig(dotted_path)
next if value.nil?
set_attribute(dotted_path, value)
end
end