Skip to content

Commit

Permalink
Consider ransack aliases when sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
faragorn committed Feb 14, 2017
1 parent 4adfd10 commit 666742c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/ransack/nodes/sort.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ def valid?
.include?(attr_name)
end

def name=(name)
@name = name
context.bind(self, name)
def name=name
@name = context.ransackable_alias(name) || name
context.bind(self, @name)
end

def dir=(dir)
Expand Down

0 comments on commit 666742c

Please sign in to comment.