I'm trying to sort my results by a method in that model but the model method needs some arguments, that's where I have problems. My model is called Event and I'm trying to use
Event.all.sort_by(&:user_score("2", "51.4980749", "10.8119977"))
The method user score needs some arguments
def user_score user_id, latitude, longitude
return 0
end
The return 0 of course is just to test it but it already fails when I call the function:
SyntaxError: (irb):12: syntax error, unexpected '(', expecting ')'
...Event.all.sort_by(&:user_score("2", "51.4980749", ...
What am I doing wrong?