Method: Ransack::Context.for

Defined in:
lib/ransack/context.rb

.for(object, options = {}) ⇒ Object



19
20
21
22
23
24
25
26
27
28
# File 'lib/ransack/context.rb', line 19

def for(object, options = {})
  context =
    if Class === object
      for_class(object, options)
    else
      for_object(object, options)
    end
  context or raise ArgumentError,
    "Don't know what context to use for #{object}"
end