lib/has_constant.rb in has_constant-0.4.2 vs lib/has_constant.rb in has_constant-0.4.3
- old
+ new
@@ -33,11 +33,11 @@
def has_constant(name, values, options = {})
singular = (options[:accessor] || name.to_s.singularize).to_s
(class << self; self; end).instance_eval do
- define_method(name.to_s, lambda { values.call.uniq }) if values.respond_to?(:call)
- define_method(name.to_s, lambda { values.uniq }) unless values.respond_to?(:call)
+ define_method(name.to_s, values) if values.respond_to?(:call)
+ define_method(name.to_s, lambda { values }) unless values.respond_to?(:call)
end
define_method(singular) do
values[instance_variable_get("@#{singular}")]
end