diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-08-26 10:23:11 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-08-26 10:23:11 -0700 |
commit | 6c7575f8e8e7b741c2ca30aff86fe566ee4d361f (patch) | |
tree | 246d9abe8c1d4a428c450276ef25d67d06161827 /lib | |
parent | 2aac990e4d68cc3cbf86ecc9565723b07f22c962 (diff) | |
parent | 481ccefedd407c1f8941596b03e72cfe35c42d41 (diff) | |
download | rails-6c7575f8e8e7b741c2ca30aff86fe566ee4d361f.tar.gz rails-6c7575f8e8e7b741c2ca30aff86fe566ee4d361f.tar.bz2 rails-6c7575f8e8e7b741c2ca30aff86fe566ee4d361f.zip |
Merge pull request #78 from ebeigarts/master
Support locking by default and disable it only for SQLite
Diffstat (limited to 'lib')
-rw-r--r-- | lib/arel/visitors/mysql.rb | 4 | ||||
-rw-r--r-- | lib/arel/visitors/oracle.rb | 4 | ||||
-rw-r--r-- | lib/arel/visitors/postgresql.rb | 3 | ||||
-rw-r--r-- | lib/arel/visitors/sqlite.rb | 5 | ||||
-rw-r--r-- | lib/arel/visitors/to_sql.rb | 3 |
5 files changed, 6 insertions, 13 deletions
diff --git a/lib/arel/visitors/mysql.rb b/lib/arel/visitors/mysql.rb index 70166a15c5..ee8483372a 100644 --- a/lib/arel/visitors/mysql.rb +++ b/lib/arel/visitors/mysql.rb @@ -28,10 +28,6 @@ module Arel "BINARY #{visit o.expr}" end - def visit_Arel_Nodes_Lock o - visit o.expr - end - ### # :'( # http://dev.mysql.com/doc/refman/5.0/en/select.html#id3482214 diff --git a/lib/arel/visitors/oracle.rb b/lib/arel/visitors/oracle.rb index 43a382886c..375f7dbfe9 100644 --- a/lib/arel/visitors/oracle.rb +++ b/lib/arel/visitors/oracle.rb @@ -3,10 +3,6 @@ module Arel class Oracle < Arel::Visitors::ToSql private - def visit_Arel_Nodes_Lock o - visit o.expr - end - def visit_Arel_Nodes_SelectStatement o o = order_hacks(o) diff --git a/lib/arel/visitors/postgresql.rb b/lib/arel/visitors/postgresql.rb index bbcefe8a8d..812710181c 100644 --- a/lib/arel/visitors/postgresql.rb +++ b/lib/arel/visitors/postgresql.rb @@ -2,9 +2,6 @@ module Arel module Visitors class PostgreSQL < Arel::Visitors::ToSql private - def visit_Arel_Nodes_Lock o - visit o.expr - end def visit_Arel_Nodes_Matches o "#{visit o.left} ILIKE #{visit o.right}" diff --git a/lib/arel/visitors/sqlite.rb b/lib/arel/visitors/sqlite.rb index 237ae913bb..2a509e95b5 100644 --- a/lib/arel/visitors/sqlite.rb +++ b/lib/arel/visitors/sqlite.rb @@ -2,6 +2,11 @@ module Arel module Visitors class SQLite < Arel::Visitors::ToSql private + + # Locks are not supported in SQLite + def visit_Arel_Nodes_Lock o + end + def visit_Arel_Nodes_SelectStatement o o.limit = Arel::Nodes::Limit.new(-1) if o.offset && !o.limit super diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index d424f8602e..b414234766 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -200,9 +200,8 @@ key on UpdateManager using UpdateManager#key= "" end - # FIXME: this does nothing on SQLLite3, but should do things on other - # databases. def visit_Arel_Nodes_Lock o + visit o.expr end def visit_Arel_Nodes_Grouping o |