1
0
Fork 0
mirror of https://github.com/kaminari/kaminari.git synced 2022-11-09 13:44:37 -05:00

Change lambda syntax for Ruby 1.8.7

This commit is contained in:
Yuki Nishijima 2014-11-22 12:09:43 -08:00
parent 68646cceed
commit efafb4d402

View file

@ -10,7 +10,7 @@ class User < ActiveRecord::Base
User.joins(:books_read => :authors).where(:authors_books => {:id => self})
end
scope :by_name, ->{ order(:name) }
scope :by_name, lambda { order(:name) }
scope :by_read_count, lambda {
cols = if connection.adapter_name == "PostgreSQL"
column_names.map { |column| %{"users"."#{column}"} }.join(", ")