diff --git a/lib/ransack/nodes/attribute.rb b/lib/ransack/nodes/attribute.rb index beac624..92a136f 100644 --- a/lib/ransack/nodes/attribute.rb +++ b/lib/ransack/nodes/attribute.rb @@ -21,8 +21,8 @@ module Ransack end def valid? - bound? && attr && - context.klassify(parent).ransackable_attributes(context.auth_object).include?(attr_name) + bound? && attr && context.klassify(parent) + .ransackable_attributes(context.auth_object).include?(attr_name) end def type diff --git a/lib/ransack/nodes/bindable.rb b/lib/ransack/nodes/bindable.rb index e4d184a..ed18e65 100644 --- a/lib/ransack/nodes/bindable.rb +++ b/lib/ransack/nodes/bindable.rb @@ -5,7 +5,9 @@ module Ransack attr_accessor :parent, :attr_name def attr - @attr ||= ransacker ? ransacker.attr_from(self) : context.table_for(parent)[attr_name] + @attr ||= ransacker ? + ransacker.attr_from(self) : + context.table_for(parent)[attr_name] end alias :arel_attribute :attr diff --git a/lib/ransack/predicate.rb b/lib/ransack/predicate.rb index 9eede59..0b4ac76 100644 --- a/lib/ransack/predicate.rb +++ b/lib/ransack/predicate.rb @@ -29,7 +29,9 @@ module Ransack end def name_from_attribute_name(attribute_name) - names_by_decreasing_length.detect { |p| attribute_name.to_s.match(/_#{p}$/) } + names_by_decreasing_length.detect { + |p| attribute_name.to_s.match(/_#{p}$/) + } end def for_attribute_name(attribute_name)