postgres_ext 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,7 @@
1
+ ## 0.2.2
2
+
3
+ * Fixes issue with visit_Array monkey patch - Dan McClain (@danmcclain)
4
+
1
5
  ## 0.2.1
2
6
 
3
7
  * Fixes issue with citext change column calls - Dan McClain
@@ -7,7 +7,7 @@ module Arel
7
7
  if last_column.respond_to?(:array) && last_column.array
8
8
  quoted o
9
9
  else
10
- o.map { |x| visit x }.join(', ')
10
+ o.empty? ? 'NULL' : o.map { |x| visit x }.join(', ')
11
11
  end
12
12
  end
13
13
  end
@@ -1,3 +1,3 @@
1
1
  module PostgresExt
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
@@ -1,23 +1,16 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe 'Ensure that we don\'t stomp on Active Record\'s queries' do
4
- let!(:adapter) { ActiveRecord::Base.connection }
5
-
6
- before do
7
- adapter.create_table :sanity_tests, :force => true do |t|
8
- t.string :tags, :array => true
9
- t.integer :tag_ids, :array => true
10
- end
11
-
12
- class SanityTest < ActiveRecord::Base
13
- attr_accessible :tags, :tags_ids
14
- end
15
- end
16
4
  describe '.where' do
17
5
  it 'generates IN clauses for non array columns' do
18
- query = SanityTest.where(:id => [1,2,3]).to_sql
6
+ query = Person.where(:id => [1,2,3]).to_sql
19
7
 
20
8
  query.should match /IN \(1, 2, 3\)/
21
9
  end
10
+ it 'generates IN clauses for non array columns' do
11
+ query = Person.where(:id => []).to_sql
12
+
13
+ query.should match /IN \(NULL\)/
14
+ end
22
15
  end
23
16
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postgres_ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-13 00:00:00.000000000 Z
12
+ date: 2013-02-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -237,7 +237,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
237
237
  version: '0'
238
238
  segments:
239
239
  - 0
240
- hash: 2858129124341141238
240
+ hash: 3137999377489191858
241
241
  required_rubygems_version: !ruby/object:Gem::Requirement
242
242
  none: false
243
243
  requirements:
@@ -246,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
246
246
  version: '0'
247
247
  segments:
248
248
  - 0
249
- hash: 2858129124341141238
249
+ hash: 3137999377489191858
250
250
  requirements: []
251
251
  rubyforge_project:
252
252
  rubygems_version: 1.8.23