upsert 1.1.5 → 1.1.6

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.
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ 1.1.6 / 2012-12-20
2
+
3
+ * Bug fixes
4
+
5
+ * Require pg-hstore >=1.1.1 which doesn't escape single quotes and backslashes when output is going to be used in a bind variable (as it is here)
6
+
1
7
  1.1.5 / 2012-12-10
2
8
 
3
9
  * Bug fixes
@@ -6,7 +6,7 @@ class Upsert
6
6
  case v
7
7
  when Hash
8
8
  # you must require 'pg_hstore' from the 'pg-hstore' gem yourself
9
- ::PgHstore.dump(v)[1...-1]
9
+ ::PgHstore.dump v, true
10
10
  else
11
11
  super
12
12
  end
@@ -1,3 +1,3 @@
1
1
  class Upsert
2
- VERSION = "1.1.5"
2
+ VERSION = "1.1.6"
3
3
  end
data/spec/hstore_spec.rb CHANGED
@@ -30,10 +30,15 @@ describe Upsert do
30
30
  crazy = PgHstore.parse row['crazy']
31
31
  crazy.should == { a: '1', whatdat: 'whodat' }
32
32
 
33
+ upsert.row({name: 'Bill'}, crazy: {whatdat: "D'ONOFRIO"})
34
+ row = Pet.connection.select_one(%{SELECT crazy FROM pets WHERE name = 'Bill'})
35
+ crazy = PgHstore.parse row['crazy']
36
+ crazy.should == { a: '1', whatdat: "D'ONOFRIO" }
37
+
33
38
  upsert.row({name: 'Bill'}, crazy: {a: 2})
34
39
  row = Pet.connection.select_one(%{SELECT crazy FROM pets WHERE name = 'Bill'})
35
40
  crazy = PgHstore.parse row['crazy']
36
- crazy.should == { a: '2', whatdat: 'whodat' }
41
+ crazy.should == { a: '2', whatdat: "D'ONOFRIO" }
37
42
  end
38
43
  end
39
44
  end if ENV['DB'] == 'postgresql'
data/upsert.gemspec CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |gem|
28
28
  gem.add_development_dependency 'yard'
29
29
  gem.add_development_dependency 'activerecord-import'
30
30
  gem.add_development_dependency 'pry'
31
- gem.add_development_dependency 'pg-hstore', ">=1.1.0"
31
+ gem.add_development_dependency 'pg-hstore', ">=1.1.2"
32
32
 
33
33
  unless RUBY_VERSION >= '1.9'
34
34
  gem.add_development_dependency 'orderedhash'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: upsert
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.1.6
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: 2012-12-10 00:00:00.000000000 Z
12
+ date: 2012-12-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec-core
@@ -162,7 +162,7 @@ dependencies:
162
162
  requirements:
163
163
  - - ! '>='
164
164
  - !ruby/object:Gem::Version
165
- version: 1.1.0
165
+ version: 1.1.2
166
166
  type: :development
167
167
  prerelease: false
168
168
  version_requirements: !ruby/object:Gem::Requirement
@@ -170,7 +170,7 @@ dependencies:
170
170
  requirements:
171
171
  - - ! '>='
172
172
  - !ruby/object:Gem::Version
173
- version: 1.1.0
173
+ version: 1.1.2
174
174
  - !ruby/object:Gem::Dependency
175
175
  name: sqlite3
176
176
  requirement: !ruby/object:Gem::Requirement