lib/amoeba/config.rb in amoeba-3.1.0 vs lib/amoeba/config.rb in amoeba-3.2.0

- old
+ new

@@ -108,11 +108,12 @@ end def include_association(value = nil, options = {}) enable @config[:excludes] = {} - push_value_to_hash({ value => options }, :includes) + value = value.is_a?(Array) ? Hash[value.map! { |v| [v, options] }] : { value => options } + push_value_to_hash(value, :includes) end def include_associations(*values) values.flatten.each { |v| include_association(v) } end @@ -124,10 +125,11 @@ end def exclude_association(value = nil, options = {}) enable @config[:includes] = {} - push_value_to_hash({ value => options }, :excludes) + value = value.is_a?(Array) ? Hash[value.map! { |v| [v, options] }] : { value => options } + push_value_to_hash(value, :excludes) end def exclude_associations(*values) values.flatten.each { |v| exclude_association(v) } end