Method: Ransack::Nodes::Condition#attributes=

Defined in:
lib/ransack/nodes/condition.rb

#attributes=(args) ⇒ Object Also known as: a=



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/ransack/nodes/condition.rb', line 79

def attributes=(args)
  case args
  when Array
    args.each do |name|
      build_attribute(name)
    end
  when Hash
    args.each do |index, attrs|
      build_attribute(attrs[:name], attrs[:ransacker_args])
    end
  else
    raise ArgumentError,
      "Invalid argument (#{args.class}) supplied to attributes="
  end
end