pgrel 0.0.1 → 0.1.0
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/.gitignore +3 -0
- data/.rubocop.yml +45 -0
- data/.travis.yml +14 -14
- data/Gemfile +9 -0
- data/README.md +2 -0
- data/gemfiles/rails40.gemfile +1 -1
- data/gemfiles/rails41.gemfile +1 -1
- data/gemfiles/rails42.gemfile +1 -1
- data/gemfiles/rails5.gemfile +1 -0
- data/lib/pgrel/active_record/query_methods.rb +31 -0
- data/lib/pgrel/active_record/store_chain/array_chain.rb +18 -0
- data/lib/pgrel/active_record/store_chain/hstore_chain.rb +36 -0
- data/lib/pgrel/active_record/store_chain/jsonb_chain.rb +76 -0
- data/lib/pgrel/active_record/store_chain.rb +176 -0
- data/lib/pgrel/active_record.rb +2 -0
- data/lib/pgrel/version.rb +1 -1
- data/lib/pgrel.rb +2 -2
- data/pgrel.gemspec +3 -4
- data/spec/pgrel/array_spec.rb +71 -0
- data/spec/pgrel/hstore_spec.rb +125 -0
- data/spec/pgrel/jsonb_spec.rb +137 -0
- data/spec/spec_helper.rb +19 -8
- data/spec/support/array_store.rb +2 -0
- data/spec/support/hstore.rb +2 -0
- data/spec/support/jsonb.rb +2 -0
- metadata +36 -65
- data/Gemfile.lock +0 -112
- data/spec/dummy/README.rdoc +0 -28
- data/spec/dummy/Rakefile +0 -6
- data/spec/dummy/app/assets/images/.keep +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +0 -13
- data/spec/dummy/app/assets/stylesheets/application.css +0 -15
- data/spec/dummy/app/controllers/application_controller.rb +0 -5
- data/spec/dummy/app/controllers/concerns/.keep +0 -0
- data/spec/dummy/app/helpers/application_helper.rb +0 -2
- data/spec/dummy/app/mailers/.keep +0 -0
- data/spec/dummy/app/models/.keep +0 -0
- data/spec/dummy/app/models/concerns/.keep +0 -0
- data/spec/dummy/app/views/layouts/application.html.erb +0 -14
- data/spec/dummy/bin/bundle +0 -3
- data/spec/dummy/bin/rails +0 -4
- data/spec/dummy/bin/rake +0 -4
- data/spec/dummy/bin/setup +0 -29
- data/spec/dummy/config/application.rb +0 -26
- data/spec/dummy/config/boot.rb +0 -5
- data/spec/dummy/config/database.yml +0 -29
- data/spec/dummy/config/environment.rb +0 -5
- data/spec/dummy/config/environments/development.rb +0 -41
- data/spec/dummy/config/environments/production.rb +0 -79
- data/spec/dummy/config/environments/test.rb +0 -42
- data/spec/dummy/config/initializers/assets.rb +0 -11
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/cookies_serializer.rb +0 -3
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/spec/dummy/config/initializers/inflections.rb +0 -16
- data/spec/dummy/config/initializers/mime_types.rb +0 -4
- data/spec/dummy/config/initializers/session_store.rb +0 -3
- data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/spec/dummy/config/locales/en.yml +0 -23
- data/spec/dummy/config/routes.rb +0 -56
- data/spec/dummy/config/secrets.yml +0 -22
- data/spec/dummy/config.ru +0 -4
- data/spec/dummy/lib/assets/.keep +0 -0
- data/spec/dummy/log/.keep +0 -0
- data/spec/dummy/public/404.html +0 -67
- data/spec/dummy/public/422.html +0 -67
- data/spec/dummy/public/500.html +0 -66
- data/spec/dummy/public/favicon.ico +0 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe Hstore do
|
|
4
|
+
before do
|
|
5
|
+
@connection = ActiveRecord::Base.connection
|
|
6
|
+
|
|
7
|
+
@connection.transaction do
|
|
8
|
+
@connection.create_table('hstores') do |t|
|
|
9
|
+
t.hstore 'tags', default: {}, null: false
|
|
10
|
+
t.string 'name'
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
Hstore.reset_column_information
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
after do
|
|
18
|
+
@connection.drop_table 'hstores', if_exists: true
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
let!(:setup) do
|
|
22
|
+
Hstore.create!(name: 'a', tags: { a: 1, b: 2, f: true, d: 'a', g: 'b' })
|
|
23
|
+
Hstore.create!(name: 'b', tags: { a: 2, d: 'b', g: 'e' })
|
|
24
|
+
Hstore.create!(name: 'c', tags: { f: true, d: 'b' })
|
|
25
|
+
Hstore.create!(name: 'd', tags: { f: false })
|
|
26
|
+
Hstore.create!(name: 'e', tags: { a: 2, c: 'x', d: 'c', g: 'c' })
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
context '#where' do
|
|
30
|
+
it 'simple values' do
|
|
31
|
+
expect(Hstore.where.store(:tags, a: 1, b: 2).first.name).to eq 'a'
|
|
32
|
+
expect(Hstore.where.store(:tags, a: 2, c: 'x').first.name).to eq 'e'
|
|
33
|
+
expect(Hstore.where.store(:tags, f: false).first.name).to eq 'd'
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
it 'arrays' do
|
|
37
|
+
expect(Hstore.where.store(:tags, a: [1, 2, 3]).size).to eq 3
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
it 'many arrays' do
|
|
41
|
+
expect(
|
|
42
|
+
Hstore.where.store(
|
|
43
|
+
:tags,
|
|
44
|
+
a: [1, 2, 3],
|
|
45
|
+
c: %w(x y z),
|
|
46
|
+
d: %w(a c),
|
|
47
|
+
g: %w(b c)
|
|
48
|
+
).size
|
|
49
|
+
).to eq 1
|
|
50
|
+
expect(
|
|
51
|
+
Hstore.where.store(
|
|
52
|
+
:tags,
|
|
53
|
+
a: [1, 2, 3],
|
|
54
|
+
d: %w(a c),
|
|
55
|
+
g: %w(b c)
|
|
56
|
+
).size
|
|
57
|
+
).to eq 2
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
it '#key' do
|
|
62
|
+
records = Hstore.where.store(:tags).key(:a)
|
|
63
|
+
expect(records.size).to eq 3
|
|
64
|
+
|
|
65
|
+
records = Hstore.where.store(:tags).key(:b)
|
|
66
|
+
expect(records.size).to eq 1
|
|
67
|
+
expect(records.first.name).to eq 'a'
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
it '#keys' do
|
|
71
|
+
records = Hstore.where.store(:tags).keys('a', 'f')
|
|
72
|
+
expect(records.size).to eq 1
|
|
73
|
+
expect(records.first.name).to eq 'a'
|
|
74
|
+
|
|
75
|
+
records = Hstore.where.store(:tags).keys([:a, :c])
|
|
76
|
+
expect(records.size).to eq 1
|
|
77
|
+
expect(records.first.name).to eq 'e'
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
it '#any' do
|
|
81
|
+
records = Hstore.where.store(:tags).any('b', 'f')
|
|
82
|
+
expect(records.size).to eq 3
|
|
83
|
+
|
|
84
|
+
records = Hstore.where.store(:tags).any([:c, :b])
|
|
85
|
+
expect(records.size).to eq 2
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
it '#contains' do
|
|
89
|
+
records = Hstore.where.store(:tags).contains(f: true)
|
|
90
|
+
expect(records.size).to eq 2
|
|
91
|
+
|
|
92
|
+
records = Hstore.where.store(:tags).contains(a: 2, c: 'x')
|
|
93
|
+
expect(records.size).to eq 1
|
|
94
|
+
expect(records.first.name).to eq 'e'
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
it '#contained' do
|
|
98
|
+
records = Hstore.where.store(:tags).contained(
|
|
99
|
+
a: 2,
|
|
100
|
+
b: 2,
|
|
101
|
+
f: true,
|
|
102
|
+
d: 'b',
|
|
103
|
+
g: 'e'
|
|
104
|
+
)
|
|
105
|
+
expect(records.size).to eq 2
|
|
106
|
+
|
|
107
|
+
records = Hstore.where.store(:tags).contained(c: 'x', f: false)
|
|
108
|
+
expect(records.size).to eq 1
|
|
109
|
+
expect(records.first.name).to eq 'd'
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
context '#not' do
|
|
113
|
+
it '#where' do
|
|
114
|
+
expect(Hstore.where.store(:tags).not(a: 1, g: 'c').size).to eq 1
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
it '#any' do
|
|
118
|
+
expect(Hstore.where.store(:tags).not.any('a', 'f').size).to eq 0
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
it '#keys' do
|
|
122
|
+
expect(Hstore.where.store(:tags).not.keys('a', 'f').size).to eq 4
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
end
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe Jsonb do
|
|
4
|
+
before do
|
|
5
|
+
@connection = ActiveRecord::Base.connection
|
|
6
|
+
|
|
7
|
+
@connection.transaction do
|
|
8
|
+
@connection.create_table('jsonbs') do |t|
|
|
9
|
+
t.jsonb 'tags', default: {}, null: false
|
|
10
|
+
t.string 'name'
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
Jsonb.reset_column_information
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
after do
|
|
18
|
+
@connection.drop_table 'jsonbs', if_exists: true
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
let!(:setup) do
|
|
22
|
+
Jsonb.create!(name: 'a')
|
|
23
|
+
Jsonb.create!(name: 'b', tags: { a: 1, d: { e: 2 } })
|
|
24
|
+
Jsonb.create!(name: 'c', tags: { a: 2, b: %w(c d) })
|
|
25
|
+
Jsonb.create!(name: 'd', tags: { a: 1, b: { c: 'd', e: true } })
|
|
26
|
+
Jsonb.create!(name: 'e', tags: { b: 2, c: 'e' })
|
|
27
|
+
Jsonb.create!(name: 'f', tags: { d: { e: 1, f: { h: { k: 'a', s: 2 } } } })
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
context '#where' do
|
|
31
|
+
it 'simple values' do
|
|
32
|
+
expect(Jsonb.where.store(:tags, b: 2, c: 'e').first.name).to eq 'e'
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
it 'nested values' do
|
|
36
|
+
expect(
|
|
37
|
+
Jsonb.where.store(
|
|
38
|
+
:tags,
|
|
39
|
+
a: 1,
|
|
40
|
+
b: { c: 'd', e: true }
|
|
41
|
+
).first.name).to eq 'd'
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
it 'arrays (as IN)' do
|
|
45
|
+
expect(Jsonb.where.store(:tags, a: [1, 2, 3]).size).to eq 3
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
context '#path' do
|
|
50
|
+
it 'pass object' do
|
|
51
|
+
expect(Jsonb.where.store(:tags).path(b: { c: 'd' }).first.name).to eq 'd'
|
|
52
|
+
|
|
53
|
+
expect(
|
|
54
|
+
Jsonb.where.store(:tags).path(
|
|
55
|
+
d: { f: { h: { s: 2 } } }
|
|
56
|
+
).first.name
|
|
57
|
+
).to eq 'f'
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
it 'pass array' do
|
|
61
|
+
expect(Jsonb.where.store(:tags).path(:b, :c, 'd').first.name).to eq 'd'
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
it 'match object' do
|
|
65
|
+
expect(
|
|
66
|
+
Jsonb.where.store(:tags).path(:d, :f, :h, k: 'a', s: 2).first.name
|
|
67
|
+
).to eq 'f'
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
it 'match array (as IN)' do
|
|
71
|
+
expect(Jsonb.where.store(:tags).path(:d, :e, [1, 2]).size).to eq 2
|
|
72
|
+
expect(Jsonb.where.store(:tags).path(d: { e: [1, 2] }).size).to eq 2
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
it '#key' do
|
|
77
|
+
records = Jsonb.where.store(:tags).key(:a)
|
|
78
|
+
expect(records.size).to eq 3
|
|
79
|
+
|
|
80
|
+
records = Jsonb.where.store(:tags).key(:c)
|
|
81
|
+
expect(records.size).to eq 1
|
|
82
|
+
expect(records.first.name).to eq 'e'
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
it '#keys' do
|
|
86
|
+
records = Jsonb.where.store(:tags).keys('a', 'b')
|
|
87
|
+
expect(records.size).to eq 2
|
|
88
|
+
|
|
89
|
+
records = Jsonb.where.store(:tags).keys([:b, :c])
|
|
90
|
+
expect(records.size).to eq 1
|
|
91
|
+
expect(records.first.name).to eq 'e'
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
it '#any' do
|
|
95
|
+
records = Jsonb.where.store(:tags).any('a', 'b')
|
|
96
|
+
expect(records.size).to eq 4
|
|
97
|
+
|
|
98
|
+
records = Jsonb.where.store(:tags).any([:c, :b])
|
|
99
|
+
expect(records.size).to eq 3
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
it '#contains' do
|
|
103
|
+
records = Jsonb.where.store(:tags).contains(a: 1)
|
|
104
|
+
expect(records.size).to eq 2
|
|
105
|
+
|
|
106
|
+
records = Jsonb.where.store(:tags).contains(a: 1, b: { c: 'd' })
|
|
107
|
+
expect(records.size).to eq 1
|
|
108
|
+
expect(records.first.name).to eq 'd'
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
it '#contained' do
|
|
112
|
+
records = Jsonb.where.store(:tags).contained(
|
|
113
|
+
a: 2,
|
|
114
|
+
b: 2,
|
|
115
|
+
f: true,
|
|
116
|
+
c: 'e',
|
|
117
|
+
g: 'e'
|
|
118
|
+
)
|
|
119
|
+
expect(records.size).to eq 2
|
|
120
|
+
|
|
121
|
+
records =
|
|
122
|
+
Jsonb
|
|
123
|
+
.where.store(:tags).key(:a)
|
|
124
|
+
.where.store(:tags).contained(a: 2, b: %w(a b c d))
|
|
125
|
+
|
|
126
|
+
expect(records.size).to eq 1
|
|
127
|
+
expect(records.first.name).to eq 'c'
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
context '#not' do
|
|
131
|
+
it '#path' do
|
|
132
|
+
expect(
|
|
133
|
+
Jsonb.where.store(:tags).not.path(:d, :f, :h, k: 'a', s: 2).size
|
|
134
|
+
).to eq 0
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
end
|
data/spec/spec_helper.rb
CHANGED
|
@@ -1,24 +1,35 @@
|
|
|
1
1
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
2
2
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
|
3
3
|
|
|
4
|
-
ENV[
|
|
5
|
-
|
|
6
|
-
unless ENV['COVER'].empty?
|
|
4
|
+
if ENV['COVER']
|
|
7
5
|
require 'simplecov'
|
|
8
|
-
SimpleCov.root File.join(File.dirname(__FILE__), '..'
|
|
6
|
+
SimpleCov.root File.join(File.dirname(__FILE__), '..')
|
|
9
7
|
SimpleCov.start
|
|
10
8
|
end
|
|
11
9
|
|
|
12
10
|
require 'rspec'
|
|
13
11
|
require 'pry-byebug'
|
|
14
|
-
require '
|
|
15
|
-
require '
|
|
12
|
+
require 'active_record'
|
|
13
|
+
require 'pg'
|
|
14
|
+
require 'pgrel'
|
|
15
|
+
|
|
16
|
+
ActiveRecord::Base.establish_connection(
|
|
17
|
+
adapter: 'postgresql',
|
|
18
|
+
host: 'localhost',
|
|
19
|
+
username: 'pgrel',
|
|
20
|
+
database: 'pgrel'
|
|
21
|
+
)
|
|
22
|
+
connection = ActiveRecord::Base.connection
|
|
23
|
+
|
|
24
|
+
unless connection.extension_enabled?('hstore')
|
|
25
|
+
connection.enable_extension 'hstore'
|
|
26
|
+
connection.commit_db_transaction
|
|
27
|
+
end
|
|
16
28
|
|
|
17
|
-
|
|
29
|
+
connection.reconnect!
|
|
18
30
|
|
|
19
31
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
|
20
32
|
|
|
21
33
|
RSpec.configure do |config|
|
|
22
34
|
config.mock_with :rspec
|
|
23
|
-
config.use_transactional_fixtures = true
|
|
24
35
|
end
|
metadata
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pgrel
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0
|
|
4
|
+
version: 0.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- palkan
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-04-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
|
-
name:
|
|
14
|
+
name: activerecord
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
17
|
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version:
|
|
19
|
+
version: 4.0.0
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version:
|
|
26
|
+
version: 4.0.0
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: pg
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- - "
|
|
31
|
+
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '0'
|
|
33
|
+
version: '0.18'
|
|
34
34
|
type: :development
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
|
-
- - "
|
|
38
|
+
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '0'
|
|
40
|
+
version: '0.18'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
42
|
+
name: rake
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
|
-
- - "
|
|
45
|
+
- - "~>"
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version:
|
|
47
|
+
version: '10.1'
|
|
48
48
|
type: :development
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
|
-
- - "
|
|
52
|
+
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version:
|
|
54
|
+
version: '10.1'
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
|
-
name:
|
|
56
|
+
name: simplecov
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
|
59
59
|
- - ">="
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
|
-
version:
|
|
61
|
+
version: 0.3.8
|
|
62
62
|
type: :development
|
|
63
63
|
prerelease: false
|
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
65
|
requirements:
|
|
66
66
|
- - ">="
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
|
-
version:
|
|
68
|
+
version: 0.3.8
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
|
-
name:
|
|
70
|
+
name: pry-byebug
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
|
72
72
|
requirements:
|
|
73
|
-
- - "
|
|
73
|
+
- - ">="
|
|
74
74
|
- !ruby/object:Gem::Version
|
|
75
|
-
version:
|
|
75
|
+
version: '0'
|
|
76
76
|
type: :development
|
|
77
77
|
prerelease: false
|
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
79
|
requirements:
|
|
80
|
-
- - "
|
|
80
|
+
- - ">="
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
|
-
version:
|
|
82
|
+
version: '0'
|
|
83
83
|
- !ruby/object:Gem::Dependency
|
|
84
|
-
name: rspec
|
|
84
|
+
name: rspec
|
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
|
86
86
|
requirements:
|
|
87
87
|
- - "~>"
|
|
@@ -102,9 +102,9 @@ extensions: []
|
|
|
102
102
|
extra_rdoc_files: []
|
|
103
103
|
files:
|
|
104
104
|
- ".gitignore"
|
|
105
|
+
- ".rubocop.yml"
|
|
105
106
|
- ".travis.yml"
|
|
106
107
|
- Gemfile
|
|
107
|
-
- Gemfile.lock
|
|
108
108
|
- MIT-LICENSE
|
|
109
109
|
- README.md
|
|
110
110
|
- Rakefile
|
|
@@ -113,50 +113,21 @@ files:
|
|
|
113
113
|
- gemfiles/rails42.gemfile
|
|
114
114
|
- gemfiles/rails5.gemfile
|
|
115
115
|
- lib/pgrel.rb
|
|
116
|
+
- lib/pgrel/active_record.rb
|
|
117
|
+
- lib/pgrel/active_record/query_methods.rb
|
|
118
|
+
- lib/pgrel/active_record/store_chain.rb
|
|
119
|
+
- lib/pgrel/active_record/store_chain/array_chain.rb
|
|
120
|
+
- lib/pgrel/active_record/store_chain/hstore_chain.rb
|
|
121
|
+
- lib/pgrel/active_record/store_chain/jsonb_chain.rb
|
|
116
122
|
- lib/pgrel/version.rb
|
|
117
123
|
- pgrel.gemspec
|
|
118
|
-
- spec/
|
|
119
|
-
- spec/
|
|
120
|
-
- spec/
|
|
121
|
-
- spec/dummy/app/assets/javascripts/application.js
|
|
122
|
-
- spec/dummy/app/assets/stylesheets/application.css
|
|
123
|
-
- spec/dummy/app/controllers/application_controller.rb
|
|
124
|
-
- spec/dummy/app/controllers/concerns/.keep
|
|
125
|
-
- spec/dummy/app/helpers/application_helper.rb
|
|
126
|
-
- spec/dummy/app/mailers/.keep
|
|
127
|
-
- spec/dummy/app/models/.keep
|
|
128
|
-
- spec/dummy/app/models/concerns/.keep
|
|
129
|
-
- spec/dummy/app/views/layouts/application.html.erb
|
|
130
|
-
- spec/dummy/bin/bundle
|
|
131
|
-
- spec/dummy/bin/rails
|
|
132
|
-
- spec/dummy/bin/rake
|
|
133
|
-
- spec/dummy/bin/setup
|
|
134
|
-
- spec/dummy/config.ru
|
|
135
|
-
- spec/dummy/config/application.rb
|
|
136
|
-
- spec/dummy/config/boot.rb
|
|
137
|
-
- spec/dummy/config/database.yml
|
|
138
|
-
- spec/dummy/config/environment.rb
|
|
139
|
-
- spec/dummy/config/environments/development.rb
|
|
140
|
-
- spec/dummy/config/environments/production.rb
|
|
141
|
-
- spec/dummy/config/environments/test.rb
|
|
142
|
-
- spec/dummy/config/initializers/assets.rb
|
|
143
|
-
- spec/dummy/config/initializers/backtrace_silencers.rb
|
|
144
|
-
- spec/dummy/config/initializers/cookies_serializer.rb
|
|
145
|
-
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
|
146
|
-
- spec/dummy/config/initializers/inflections.rb
|
|
147
|
-
- spec/dummy/config/initializers/mime_types.rb
|
|
148
|
-
- spec/dummy/config/initializers/session_store.rb
|
|
149
|
-
- spec/dummy/config/initializers/wrap_parameters.rb
|
|
150
|
-
- spec/dummy/config/locales/en.yml
|
|
151
|
-
- spec/dummy/config/routes.rb
|
|
152
|
-
- spec/dummy/config/secrets.yml
|
|
153
|
-
- spec/dummy/lib/assets/.keep
|
|
154
|
-
- spec/dummy/log/.keep
|
|
155
|
-
- spec/dummy/public/404.html
|
|
156
|
-
- spec/dummy/public/422.html
|
|
157
|
-
- spec/dummy/public/500.html
|
|
158
|
-
- spec/dummy/public/favicon.ico
|
|
124
|
+
- spec/pgrel/array_spec.rb
|
|
125
|
+
- spec/pgrel/hstore_spec.rb
|
|
126
|
+
- spec/pgrel/jsonb_spec.rb
|
|
159
127
|
- spec/spec_helper.rb
|
|
128
|
+
- spec/support/array_store.rb
|
|
129
|
+
- spec/support/hstore.rb
|
|
130
|
+
- spec/support/jsonb.rb
|
|
160
131
|
homepage: http://github.com/palkan/pgrel
|
|
161
132
|
licenses:
|
|
162
133
|
- MIT
|
data/Gemfile.lock
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
PATH
|
|
2
|
-
remote: .
|
|
3
|
-
specs:
|
|
4
|
-
pgrel (0.0.1)
|
|
5
|
-
rails (~> 4.2.0)
|
|
6
|
-
|
|
7
|
-
GEM
|
|
8
|
-
remote: https://rubygems.org/
|
|
9
|
-
specs:
|
|
10
|
-
actionmailer (4.2.0)
|
|
11
|
-
actionpack (= 4.2.0)
|
|
12
|
-
actionview (= 4.2.0)
|
|
13
|
-
activejob (= 4.2.0)
|
|
14
|
-
mail (~> 2.5, >= 2.5.4)
|
|
15
|
-
rails-dom-testing (~> 1.0, >= 1.0.5)
|
|
16
|
-
actionpack (4.2.0)
|
|
17
|
-
actionview (= 4.2.0)
|
|
18
|
-
activesupport (= 4.2.0)
|
|
19
|
-
rack (~> 1.6.0)
|
|
20
|
-
rack-test (~> 0.6.2)
|
|
21
|
-
rails-dom-testing (~> 1.0, >= 1.0.5)
|
|
22
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.1)
|
|
23
|
-
actionview (4.2.0)
|
|
24
|
-
activesupport (= 4.2.0)
|
|
25
|
-
builder (~> 3.1)
|
|
26
|
-
erubis (~> 2.7.0)
|
|
27
|
-
rails-dom-testing (~> 1.0, >= 1.0.5)
|
|
28
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.1)
|
|
29
|
-
activejob (4.2.0)
|
|
30
|
-
activesupport (= 4.2.0)
|
|
31
|
-
globalid (>= 0.3.0)
|
|
32
|
-
activemodel (4.2.0)
|
|
33
|
-
activesupport (= 4.2.0)
|
|
34
|
-
builder (~> 3.1)
|
|
35
|
-
activerecord (4.2.0)
|
|
36
|
-
activemodel (= 4.2.0)
|
|
37
|
-
activesupport (= 4.2.0)
|
|
38
|
-
arel (~> 6.0)
|
|
39
|
-
activesupport (4.2.0)
|
|
40
|
-
i18n (~> 0.7)
|
|
41
|
-
json (~> 1.7, >= 1.7.7)
|
|
42
|
-
minitest (~> 5.1)
|
|
43
|
-
thread_safe (~> 0.3, >= 0.3.4)
|
|
44
|
-
tzinfo (~> 1.1)
|
|
45
|
-
arel (6.0.0)
|
|
46
|
-
builder (3.2.2)
|
|
47
|
-
erubis (2.7.0)
|
|
48
|
-
globalid (0.3.3)
|
|
49
|
-
activesupport (>= 4.1.0)
|
|
50
|
-
hike (1.2.3)
|
|
51
|
-
i18n (0.7.0)
|
|
52
|
-
json (1.8.2)
|
|
53
|
-
loofah (2.0.1)
|
|
54
|
-
nokogiri (>= 1.5.9)
|
|
55
|
-
mail (2.6.3)
|
|
56
|
-
mime-types (>= 1.16, < 3)
|
|
57
|
-
mime-types (2.4.3)
|
|
58
|
-
mini_portile (0.6.2)
|
|
59
|
-
minitest (5.5.1)
|
|
60
|
-
multi_json (1.11.0)
|
|
61
|
-
nokogiri (1.6.6.2)
|
|
62
|
-
mini_portile (~> 0.6.0)
|
|
63
|
-
rack (1.6.0)
|
|
64
|
-
rack-test (0.6.3)
|
|
65
|
-
rack (>= 1.0)
|
|
66
|
-
rails (4.2.0)
|
|
67
|
-
actionmailer (= 4.2.0)
|
|
68
|
-
actionpack (= 4.2.0)
|
|
69
|
-
actionview (= 4.2.0)
|
|
70
|
-
activejob (= 4.2.0)
|
|
71
|
-
activemodel (= 4.2.0)
|
|
72
|
-
activerecord (= 4.2.0)
|
|
73
|
-
activesupport (= 4.2.0)
|
|
74
|
-
bundler (>= 1.3.0, < 2.0)
|
|
75
|
-
railties (= 4.2.0)
|
|
76
|
-
sprockets-rails
|
|
77
|
-
rails-deprecated_sanitizer (1.0.3)
|
|
78
|
-
activesupport (>= 4.2.0.alpha)
|
|
79
|
-
rails-dom-testing (1.0.5)
|
|
80
|
-
activesupport (>= 4.2.0.beta, < 5.0)
|
|
81
|
-
nokogiri (~> 1.6.0)
|
|
82
|
-
rails-deprecated_sanitizer (>= 1.0.1)
|
|
83
|
-
rails-html-sanitizer (1.0.1)
|
|
84
|
-
loofah (~> 2.0)
|
|
85
|
-
railties (4.2.0)
|
|
86
|
-
actionpack (= 4.2.0)
|
|
87
|
-
activesupport (= 4.2.0)
|
|
88
|
-
rake (>= 0.8.7)
|
|
89
|
-
thor (>= 0.18.1, < 2.0)
|
|
90
|
-
rake (10.4.2)
|
|
91
|
-
sprockets (2.12.3)
|
|
92
|
-
hike (~> 1.2)
|
|
93
|
-
multi_json (~> 1.0)
|
|
94
|
-
rack (~> 1.0)
|
|
95
|
-
tilt (~> 1.1, != 1.3.0)
|
|
96
|
-
sprockets-rails (2.2.4)
|
|
97
|
-
actionpack (>= 3.0)
|
|
98
|
-
activesupport (>= 3.0)
|
|
99
|
-
sprockets (>= 2.8, < 4.0)
|
|
100
|
-
sqlite3 (1.3.10)
|
|
101
|
-
thor (0.19.1)
|
|
102
|
-
thread_safe (0.3.4)
|
|
103
|
-
tilt (1.4.1)
|
|
104
|
-
tzinfo (1.2.2)
|
|
105
|
-
thread_safe (~> 0.1)
|
|
106
|
-
|
|
107
|
-
PLATFORMS
|
|
108
|
-
ruby
|
|
109
|
-
|
|
110
|
-
DEPENDENCIES
|
|
111
|
-
pgrel!
|
|
112
|
-
sqlite3
|
data/spec/dummy/README.rdoc
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
== README
|
|
2
|
-
|
|
3
|
-
This README would normally document whatever steps are necessary to get the
|
|
4
|
-
application up and running.
|
|
5
|
-
|
|
6
|
-
Things you may want to cover:
|
|
7
|
-
|
|
8
|
-
* Ruby version
|
|
9
|
-
|
|
10
|
-
* System dependencies
|
|
11
|
-
|
|
12
|
-
* Configuration
|
|
13
|
-
|
|
14
|
-
* Database creation
|
|
15
|
-
|
|
16
|
-
* Database initialization
|
|
17
|
-
|
|
18
|
-
* How to run the test suite
|
|
19
|
-
|
|
20
|
-
* Services (job queues, cache servers, search engines, etc.)
|
|
21
|
-
|
|
22
|
-
* Deployment instructions
|
|
23
|
-
|
|
24
|
-
* ...
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Please feel free to use a different markup language if you do not plan to run
|
|
28
|
-
<tt>rake doc:app</tt>.
|
data/spec/dummy/Rakefile
DELETED
|
File without changes
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
|
2
|
-
// listed below.
|
|
3
|
-
//
|
|
4
|
-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
|
5
|
-
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
|
6
|
-
//
|
|
7
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
|
8
|
-
// compiled file.
|
|
9
|
-
//
|
|
10
|
-
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
|
|
11
|
-
// about supported directives.
|
|
12
|
-
//
|
|
13
|
-
//= require_tree .
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
|
3
|
-
* listed below.
|
|
4
|
-
*
|
|
5
|
-
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
|
6
|
-
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
|
7
|
-
*
|
|
8
|
-
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
|
9
|
-
* compiled file so the styles you add here take precedence over styles defined in any styles
|
|
10
|
-
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
|
|
11
|
-
* file per style scope.
|
|
12
|
-
*
|
|
13
|
-
*= require_tree .
|
|
14
|
-
*= require_self
|
|
15
|
-
*/
|
|
File without changes
|