Skip to content

Commit

Permalink
Add compatibility with rails 5
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrachev committed Jan 25, 2016
1 parent 4d9c487 commit 89d1a1e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/marginalia.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ def exec_query_with_marginalia(sql, name = 'SQL', binds = [])
exec_query_without_marginalia(annotate_sql(sql), name, binds)
end

if ActiveRecord::VERSION::MAJOR >= 5
def exec_query_with_marginalia(sql, name = 'SQL', binds = [], options = {})
options[:prepare] ||= false
exec_query_without_marginalia(annotate_sql(sql), name, binds, options)
end
end

def exec_delete_with_marginalia(sql, name = 'SQL', binds = [])
exec_delete_without_marginalia(annotate_sql(sql), name, binds)
end
Expand Down

0 comments on commit 89d1a1e

Please sign in to comment.