class Ransack::Nodes::Attribute
Attributes
Public Class Methods
Source
# File lib/ransack/nodes/attribute.rb, line 11 def initialize(context, name = nil, ransacker_args = []) super(context) self.name = name unless name.blank? @ransacker_args = ransacker_args end
Calls superclass method
Public Instance Methods
Source
# File lib/ransack/nodes/attribute.rb, line 27 def associated_collection? parent.respond_to?(:reflection) && parent.reflection.collection? end
Source
# File lib/ransack/nodes/attribute.rb, line 39 def eql?(other) self.class == other.class && self.name == other.name end
Also aliased as: ==
Source
# File lib/ransack/nodes/attribute.rb, line 53 def inspect "Attribute <#{name}>" end
Source
# File lib/ransack/nodes/attribute.rb, line 31 def type if ransacker ransacker.type else context.type_for(self) end end
Source
# File lib/ransack/nodes/attribute.rb, line 21 def valid? bound? && attr && context.klassify(parent).ransackable_attributes(context.auth_object) .include?(attr_name.split('.').last) end