arel 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -102,4 +102,5 @@ spec/table_spec.rb
102
102
  spec/update_manager_spec.rb
103
103
  spec/visitors/join_sql_spec.rb
104
104
  spec/visitors/oracle_spec.rb
105
+ spec/visitors/postgres_spec.rb
105
106
  spec/visitors/to_sql_spec.rb
@@ -27,7 +27,7 @@ require 'arel/sql_literal'
27
27
  ####
28
28
 
29
29
  module Arel
30
- VERSION = '2.0.0'
30
+ VERSION = '2.0.1'
31
31
 
32
32
  def self.sql raw_sql
33
33
  Arel::Nodes::SqlLiteral.new raw_sql
@@ -2,6 +2,10 @@ module Arel
2
2
  module Visitors
3
3
  class PostgreSQL < Arel::Visitors::ToSql
4
4
  private
5
+ def visit_Arel_Nodes_Lock o
6
+ "FOR UPDATE"
7
+ end
8
+
5
9
  def visit_Arel_Nodes_SelectStatement o
6
10
  if !o.orders.empty? && using_distinct_on?(o)
7
11
  subquery = o.dup
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+
3
+ module Arel
4
+ module Visitors
5
+ describe 'the postgres visitor' do
6
+ before do
7
+ @visitor = PostgreSQL.new Table.engine
8
+ end
9
+
10
+ it 'should produce a lock value' do
11
+ @visitor.accept(Nodes::Lock.new).should be_like %{
12
+ FOR UPDATE
13
+ }
14
+ end
15
+ end
16
+ end
17
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arel
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 0
10
- version: 2.0.0
9
+ - 1
10
+ version: 2.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Aaron Patterson
@@ -189,6 +189,7 @@ files:
189
189
  - spec/update_manager_spec.rb
190
190
  - spec/visitors/join_sql_spec.rb
191
191
  - spec/visitors/oracle_spec.rb
192
+ - spec/visitors/postgres_spec.rb
192
193
  - spec/visitors/to_sql_spec.rb
193
194
  has_rdoc: true
194
195
  homepage: http://github.com/rails/arel