dynamic_attributes 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/dynamic_attributes.rb +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.1
|
data/lib/dynamic_attributes.rb
CHANGED
@@ -54,7 +54,7 @@ module DynamicAttributes
|
|
54
54
|
# Overrides the initializer to take dynamic attributes into account
|
55
55
|
def initialize(attributes = nil)
|
56
56
|
dynamic_attributes = {}
|
57
|
-
attributes.each{|att,value| dynamic_attributes[att] = value if att.to_s.starts_with?(self.dynamic_attribute_prefix) }
|
57
|
+
(attributes ||= {}).each{|att,value| dynamic_attributes[att] = value if att.to_s.starts_with?(self.dynamic_attribute_prefix) }
|
58
58
|
super(attributes.except(*dynamic_attributes.keys))
|
59
59
|
set_dynamic_attributes(dynamic_attributes)
|
60
60
|
end
|