lib/has_constant.rb in has_constant-0.4.0 vs lib/has_constant.rb in has_constant-0.4.1

- 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, values) if values.respond_to?(:call) - define_method(name.to_s, lambda { values }) unless values.respond_to?(:call) + values = values.call if values.respond_to?(:call) + define_method(name.to_s, lambda { values.uniq }) end define_method(singular) do values[instance_variable_get("@#{singular}")] end