Skip to content

Commit

Permalink
Disable order compatible mode for ActiveRecord < 5
Browse files Browse the repository at this point in the history
There is a bug with order and last:
rzane#84
  • Loading branch information
bhaak committed Jun 27, 2018
1 parent 3d675fc commit cbdc012
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/baby_squeel/compat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def select(*args, &block)
end

# Overrides ActiveRecord::QueryMethods#order
if ::ActiveRecord.version >= Gem::Version.new("5")
def order(*args, &block)
if block_given? && args.empty?
ordering(&block)
Expand All @@ -135,6 +136,7 @@ def reorder(*args, &block)
super
end
end
end

# Overrides ActiveRecord::QueryMethods#group
def group(*args, &block)
Expand Down

0 comments on commit cbdc012

Please sign in to comment.