class Ransack::Nodes::Condition
def build_attribute(name = nil, ransacker_args = [])
isn't fixing issue #701 by introducing untested regressions.
TODO: Add test coverage for this behavior and ensure that `name.nil?`
built. The `name.nil?` conditional below currently does this.
#valid? conditional needs to be bypassed, otherwise nothing is
2. Nodes::Grouping#new_condition without arguments. In this case, the
and +ransacker_args+. Attributes are included only if #valid?.
1. Nodes::Condition#attributes=, with +name+ argument passed or +name+
After refactoring in 235eae3, it is now called from 2 places:
grouping condition.
only, without arguments, without #valid? checking, to build a new
This method was originally called from Nodes::Grouping#new_condition
== build_attribute
def build_attribute(name = nil, ransacker_args = []) Attribute.new(@context, name, ransacker_args).tap do |attribute| @context.bind(attribute, attribute.name) self.attributes << attribute if name.nil? || attribute.valid? if predicate && !negative? @context.lock_association(attribute.parent) end end end