class Ransack::Nodes::Attribute
Attributes
name[R]
ransacker_args[R]
Public Class Methods
new(context, name = nil, ransacker_args = [])
click to toggle source
Calls superclass method
# 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
Public Instance Methods
associated_collection?()
click to toggle source
# File lib/ransack/nodes/attribute.rb, line 27 def associated_collection? parent.respond_to?(:reflection) && parent.reflection.collection? end
eql?(other)
click to toggle source
# File lib/ransack/nodes/attribute.rb, line 39 def eql?(other) self.class == other.class && self.name == other.name end
Also aliased as: ==
hash()
click to toggle source
# File lib/ransack/nodes/attribute.rb, line 45 def hash self.name.hash end
inspect()
click to toggle source
# File lib/ransack/nodes/attribute.rb, line 53 def inspect "Attribute <#{name}>" end
name=(name)
click to toggle source
# File lib/ransack/nodes/attribute.rb, line 17 def name=(name) @name = name end
persisted?()
click to toggle source
# File lib/ransack/nodes/attribute.rb, line 49 def persisted? false end
type()
click to toggle source
# File lib/ransack/nodes/attribute.rb, line 31 def type if ransacker ransacker.type else context.type_for(self) end end
valid?()
click to toggle 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