module Ransack::Nodes::Bindable
Attributes
Public Instance Methods
Source
# File lib/ransack/nodes/bindable.rb, line 7 def attr @attr ||= get_arel_attribute end
Also aliased as: arel_attribute
Source
# File lib/ransack/nodes/bindable.rb, line 20 def bound? attr_name.present? && parent.present? end
Source
# File lib/ransack/nodes/bindable.rb, line 16 def klass @klass ||= context.klassify(parent) end
Source
# File lib/ransack/nodes/bindable.rb, line 12 def ransacker klass._ransackers[attr_name] end
Source
# File lib/ransack/nodes/bindable.rb, line 24 def reset_binding! @parent = @attr_name = @attr = @klass = nil end
Private Instance Methods
Source
# File lib/ransack/nodes/bindable.rb, line 30 def get_arel_attribute if ransacker ransacker.attr_from(self) else get_attribute end end
Source
# File lib/ransack/nodes/bindable.rb, line 38 def get_attribute if is_alias_attribute? context.table_for(parent)[parent.base_klass.attribute_aliases[attr_name]] else context.table_for(parent)[attr_name] end end
Source
# File lib/ransack/nodes/bindable.rb, line 46 def is_alias_attribute? Ransack::SUPPORTS_ATTRIBUTE_ALIAS && parent.base_klass.attribute_aliases.key?(attr_name) end