hstore_accessor 0.5.2 → 0.5.3
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.
- checksums.yaml +4 -4
- data/Gemfile +8 -0
- data/README.md +3 -1
- data/hstore_accessor.gemspec +0 -1
- data/lib/hstore_accessor/version.rb +1 -1
- data/spec/spec_helper.rb +19 -13
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f14646994d4c0a4584452c2238844e4a976e7f7
|
4
|
+
data.tar.gz: dd45d154dcb02ae44094097d9ed3b98978f995d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ce575626467e83fc0ca93559d1916c8f7a48e769b40ad318808adc01f3192c938b1e16af45f1c457aa946c1c5e83352224290fb4cd954156732a57a65832775
|
7
|
+
data.tar.gz: 842031d1a0705948ba510df7999c5031fc3f549d15853de0de99892b1e2b5fba5e2859e2002c283aeb82369518f7154f400690c29be348b7c1000c2cd06e2f9b
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
+

|
2
|
+
|
1
3
|
# HstoreAccessor
|
2
4
|
|
3
5
|
PostgreSQL provides an hstore data type for storing arbitrarily complex
|
4
6
|
structures in a column. ActiveRecord 4.0 supports Hstore but casts all
|
5
|
-
|
7
|
+
values in the store to a string. Further, ActiveRecord does not provide
|
6
8
|
discrete fields to access values directly in the hstore column. The
|
7
9
|
HstoreAccessor gem solves both of these issues.
|
8
10
|
|
data/hstore_accessor.gemspec
CHANGED
@@ -18,7 +18,6 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "pg", ">= 0.14.1"
|
22
21
|
spec.add_dependency "activesupport", ">= 3.2.0"
|
23
22
|
|
24
23
|
spec.add_development_dependency "activerecord", ">= 4.0.0"
|
data/spec/spec_helper.rb
CHANGED
@@ -1,25 +1,31 @@
|
|
1
1
|
require "hstore_accessor"
|
2
2
|
require "database_cleaner"
|
3
3
|
|
4
|
-
ActiveRecord::Base.establish_connection(
|
5
|
-
adapter: "postgresql",
|
6
|
-
database: "hstore_accessor",
|
7
|
-
username: "root"
|
8
|
-
)
|
9
|
-
|
10
|
-
ActiveRecord::Base.connection.execute("CREATE EXTENSION hstore;") rescue ActiveRecord::StatementInvalid
|
11
|
-
ActiveRecord::Base.connection.execute("DROP TABLE IF EXISTS products;")
|
12
|
-
|
13
|
-
ActiveRecord::Base.connection.create_table(:products) do |t|
|
14
|
-
t.hstore :options
|
15
|
-
end
|
16
|
-
|
17
4
|
DatabaseCleaner.strategy = :truncation
|
18
5
|
|
19
6
|
RSpec.configure do |config|
|
20
7
|
config.mock_with :rspec
|
21
8
|
|
9
|
+
config.before :suite do
|
10
|
+
create_database
|
11
|
+
end
|
12
|
+
|
22
13
|
config.before do
|
23
14
|
DatabaseCleaner.clean
|
24
15
|
end
|
25
16
|
end
|
17
|
+
|
18
|
+
def create_database
|
19
|
+
ActiveRecord::Base.establish_connection(
|
20
|
+
adapter: "postgresql",
|
21
|
+
database: "hstore_accessor",
|
22
|
+
username: "postgres"
|
23
|
+
)
|
24
|
+
|
25
|
+
ActiveRecord::Base.connection.execute("CREATE EXTENSION hstore;") rescue ActiveRecord::StatementInvalid
|
26
|
+
ActiveRecord::Base.connection.execute("DROP TABLE IF EXISTS products;")
|
27
|
+
|
28
|
+
ActiveRecord::Base.connection.create_table(:products) do |t|
|
29
|
+
t.hstore :options
|
30
|
+
end
|
31
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hstore_accessor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Hirn
|
@@ -10,22 +10,8 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-
|
13
|
+
date: 2014-02-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
|
-
- !ruby/object:Gem::Dependency
|
16
|
-
name: pg
|
17
|
-
requirement: !ruby/object:Gem::Requirement
|
18
|
-
requirements:
|
19
|
-
- - ">="
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: 0.14.1
|
22
|
-
type: :runtime
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
requirements:
|
26
|
-
- - ">="
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
version: 0.14.1
|
29
15
|
- !ruby/object:Gem::Dependency
|
30
16
|
name: activesupport
|
31
17
|
requirement: !ruby/object:Gem::Requirement
|