Skip to content

Commit

Permalink
Fixed: Rails 4.2: NoMethodError: undefined method asc for #<Arel::Nod…
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-franko committed Feb 25, 2018
1 parent 7dbec58 commit 76ea47a
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions lib/ransack/visitor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,6 @@ def visit_or(object)
end
end

def visit_Ransack_Nodes_Sort(object)
return unless object.valid?
if object.attr.is_a? Arel::Attributes::Attribute
object.attr.send(object.dir)
else
ordered object
end
end

def quoted?(object)
raise "not implemented"
end
Expand All @@ -62,16 +53,5 @@ def visit(object)
klass.name.gsub(Constants::TWO_COLONS, Constants::UNDERSCORE)
}"
end

private

def ordered(object)
case object.dir
when 'asc'.freeze
Arel::Nodes::Ascending.new(object.attr)
when 'desc'.freeze
Arel::Nodes::Descending.new(object.attr)
end
end
end
end

0 comments on commit 76ea47a

Please sign in to comment.