Skip to content

Commit

Permalink
Merge pull request #885 from roman-franko/master
Browse files Browse the repository at this point in the history
Fixed: Rails 4.2: NoMethodError: undefined method asc for #<Arel::Nod…
  • Loading branch information
scarroll32 authored Feb 28, 2018
2 parents 275e8c1 + 76ea47a commit 1faf48b
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 1faf48b

Please sign in to comment.