1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/lib/arel/visitors/sqlite.rb

28 lines
609 B
Ruby
Raw Normal View History

2016-08-31 11:20:36 -04:00
# frozen_string_literal: true
2018-02-24 01:45:50 -05:00
2018-02-24 02:41:47 -05:00
module Arel # :nodoc: all
module Visitors
class SQLite < Arel::Visitors::ToSql
private
2018-02-24 01:45:50 -05:00
# Locks are not supported in SQLite
def visit_Arel_Nodes_Lock(o, collector)
collector
end
2018-02-24 01:45:50 -05:00
def visit_Arel_Nodes_SelectStatement(o, collector)
o.limit = Arel::Nodes::Limit.new(-1) if o.offset && !o.limit
super
end
2018-02-24 01:45:50 -05:00
def visit_Arel_Nodes_True(o, collector)
collector << "1"
end
2018-02-24 01:45:50 -05:00
def visit_Arel_Nodes_False(o, collector)
collector << "0"
end
end
end
end