module Ransack::Nodes::Bindable

Attributes

attr_name[RW]
parent[RW]

Public Instance Methods

arel_attribute()
Alias for: attr
attr() click to toggle source
# File lib/ransack/nodes/bindable.rb, line 7
def attr
  @attr ||= get_arel_attribute
end
Also aliased as: arel_attribute
bound?() click to toggle source
# File lib/ransack/nodes/bindable.rb, line 20
def bound?
  attr_name.present? && parent.present?
end
klass() click to toggle source
# File lib/ransack/nodes/bindable.rb, line 16
def klass
  @klass ||= context.klassify(parent)
end
ransacker() click to toggle source
# File lib/ransack/nodes/bindable.rb, line 12
def ransacker
  klass._ransackers[attr_name]
end
reset_binding!() click to toggle source
# File lib/ransack/nodes/bindable.rb, line 24
def reset_binding!
  @parent = @attr_name = @attr = @klass = nil
end

Private Instance Methods

get_arel_attribute() click to toggle source
# File lib/ransack/nodes/bindable.rb, line 30
def get_arel_attribute
  if ransacker
    ransacker.attr_from(self)
  else
    context.table_for(parent)[attr_name]
  end
end