activerecord2-hstore 1.0.4 → 1.0.5

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,6 @@
1
+ 1.0.5
2
+ * Now correctly writes valid hstore syntax for PostgreSQL 9.2
3
+
1
4
  1.0.4
2
5
  * Better fix for passing in nil, string, or hash into ActiveRecord setter (@kwstannard)
3
6
  * Additional and improved specs
@@ -0,0 +1,13 @@
1
+ module ActiveRecord
2
+ module ConnectionAdapters
3
+ class PostgreSQLAdapter < AbstractAdapter
4
+ def quote_with_hstore(value, column=nil)
5
+ # We must escape quotes here
6
+ return "hstore('#{value.gsub("'", "''")}')" if column && column.sql_type == "hstore"
7
+ quote_without_hstore(value, column)
8
+ end
9
+
10
+ alias_method_chain :quote, :hstore
11
+ end
12
+ end
13
+ end
@@ -1,5 +1,5 @@
1
1
  module Activerecord2
2
2
  module Hstore
3
- VERSION = "1.0.4"
3
+ VERSION = "1.0.5"
4
4
  end
5
5
  end
@@ -2,6 +2,7 @@ require "activerecord2-hstore/version"
2
2
  require "activerecord2-hstore/string"
3
3
  require "activerecord2-hstore/hash"
4
4
  require "activerecord2-hstore/hstore"
5
+ require "activerecord2-hstore/active_record"
5
6
 
6
7
  module Activerecord2
7
8
  module Hstore
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord2-hstore
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 4
10
- version: 1.0.4
9
+ - 5
10
+ version: 1.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tony Drake
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-07-31 00:00:00 Z
18
+ date: 2012-10-21 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rspec
@@ -97,6 +97,7 @@ files:
97
97
  - Rakefile
98
98
  - activerecord2-hstore.gemspec
99
99
  - lib/activerecord2-hstore.rb
100
+ - lib/activerecord2-hstore/active_record.rb
100
101
  - lib/activerecord2-hstore/hash.rb
101
102
  - lib/activerecord2-hstore/hstore.rb
102
103
  - lib/activerecord2-hstore/string.rb