activerecord-pg_array 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/.rspec +2 -0
- data/Guardfile +11 -0
- data/README.md +53 -24
- data/Rakefile +5 -0
- data/activerecord-pg_array.gemspec +7 -2
- data/lib/activerecord/pg_array/version.rb +1 -1
- data/lib/activerecord/pg_array.rb +36 -8
- data/spec/lib/pg_array_spec.rb +126 -0
- data/spec/schema.rb +32 -0
- data/spec/spec_helper.rb +19 -0
- data/spec/support/active_record.rb +17 -0
- metadata +91 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5469d83f3321a3a99f615391b6561474db1cf71f
|
4
|
+
data.tar.gz: 866d1ca55c92eec1b9200d875f58d33adb4c272d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44adb77c3d1ec61dabec9b7b81354091710182f24d8185fae634b2cd15d467b68b04a71fdcdefa2df557e54611623050e72c1800ac8d8c64aa888f8ec3ec1941
|
7
|
+
data.tar.gz: 44f69af520b86d204595551b70d8a62081f1c1143f596b8531f1ac84cfd6bd518f8369c57b7e1d592480372df82d8387f9ba0dc3e6d3ed4f8968c6b6e82f6155
|
data/.rspec
ADDED
data/Guardfile
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
guard :rspec do
|
5
|
+
watch(%r{^spec/.+_spec\.rb$})
|
6
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
7
|
+
watch('spec/spec_helper.rb') { "spec" }
|
8
|
+
|
9
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
10
|
+
end
|
11
|
+
|
data/README.md
CHANGED
@@ -1,52 +1,81 @@
|
|
1
|
-
#
|
1
|
+
# ActiveRecord::PGArray
|
2
2
|
|
3
|
-
This gem defines methods in your models for ActiveRecord attributes that use
|
3
|
+
This gem defines methods in your models for ActiveRecord attributes that use Postgresql's arrays.
|
4
4
|
|
5
|
-
I wrote this gem because I realized that working with Postgresql arrays was not as straight-forward as I had hoped.
|
5
|
+
I wrote this gem because I realized that working with Postgresql arrays was not as straight-forward as I had hoped.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
9
9
|
Add this line to your application's Gemfile:
|
10
10
|
|
11
|
-
|
11
|
+
```ruby
|
12
|
+
gem 'activerecord-pg_array'
|
13
|
+
```
|
12
14
|
|
13
15
|
## Usage
|
14
16
|
|
15
17
|
Then in your classes that inherit from ActiveRecord `include ActiveRecord::PGArray`
|
16
18
|
|
17
|
-
### Example:
|
19
|
+
### Silly Example:
|
18
20
|
|
19
21
|
Given the following migration:
|
20
22
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
add_index :my_models, :friend_ids, using: 'gin'
|
29
|
-
end
|
23
|
+
```ruby
|
24
|
+
class CreateWoldTracker < ActiveRecord::Migration
|
25
|
+
def change
|
26
|
+
create_table :wolf_trackers do |t|
|
27
|
+
t.string :name
|
28
|
+
t.integer :wolf_ids, array: true, default: []
|
29
|
+
t.string :pack_names, array: true, default: []
|
30
30
|
end
|
31
31
|
|
32
|
+
add_index :wolf_trackers, :wolf_ids, using: 'gin'
|
33
|
+
end
|
34
|
+
end
|
35
|
+
```
|
36
|
+
|
32
37
|
And class:
|
33
38
|
|
34
|
-
|
35
|
-
|
36
|
-
|
39
|
+
```ruby
|
40
|
+
class WolfTracker < ActiveRecord::Base
|
41
|
+
include ActiveRecord::PGArray
|
42
|
+
end
|
43
|
+
```
|
37
44
|
|
38
45
|
The following methods are automatically defined for "friend_ids":
|
39
46
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
47
|
+
```ruby
|
48
|
+
add_wolf(wolfy) # ActiveRecord object wolfy's id is appended to wolf_ids
|
49
|
+
add_wolf!(son_of_wolfy) # wolf_ids appended with atomic update
|
50
|
+
add_wolves([wolfia, 4]) # add multiple to wolf_ids. Note: irregular plural method name and mixed input
|
51
|
+
remove_wolf(wolfia) # wolf_ids is modified but not saved
|
52
|
+
remove_wolf!(3) # wolf_ids atomic removal
|
53
|
+
wolves # looks up wolf objects with ids wolf_ids
|
54
|
+
```
|
55
|
+
|
56
|
+
The same is true for pack_names:
|
57
|
+
|
58
|
+
```ruby
|
59
|
+
add_pack_name('Stark')
|
60
|
+
add_pack_name!('Karstark')
|
61
|
+
add_pack_names(['Greyjoy', 'Bolton'])
|
62
|
+
remove_pack_name('Greyjoy')
|
63
|
+
remove_pack_name!('Bolton')
|
64
|
+
# does not define a finder method based on pack_names
|
65
|
+
```
|
66
|
+
|
67
|
+
## Dynamically created method rules
|
68
|
+
|
69
|
+
* If an ActiveRecord attribute ends with "_ids", that suffix will be removed from the method name.
|
70
|
+
* If the attribute is an array of integers ending with "_ids", then if an ActiveRecord object is passed to it, the id of that object will used.
|
71
|
+
* Method names will use the singular or plural form of the attribute name when defining the method.
|
45
72
|
|
46
73
|
## Roadmap
|
47
74
|
|
48
|
-
*
|
49
|
-
*
|
75
|
+
* Finish writing all specs
|
76
|
+
* Actual atomic operations :)
|
77
|
+
* Perhaps add some handy query interface stuff or at least document how query arrays with ActiveRecord.
|
78
|
+
* rdoc documentation
|
50
79
|
|
51
80
|
## Contributing
|
52
81
|
|
data/Rakefile
CHANGED
@@ -19,7 +19,12 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_dependency
|
22
|
+
spec.add_dependency "activerecord", "~> 3.0"
|
23
23
|
spec.add_development_dependency "bundler", "~> 1.3"
|
24
|
-
spec.add_development_dependency "rake"
|
24
|
+
spec.add_development_dependency "rake", "~> 10.1"
|
25
|
+
spec.add_development_dependency "rspec", "~> 2.14"
|
26
|
+
spec.add_development_dependency "pg", "~> 0.17"
|
27
|
+
spec.add_development_dependency "pry", "~> 0.9"
|
28
|
+
spec.add_development_dependency "guard", "~> 2.4"
|
29
|
+
spec.add_development_dependency "guard-rspec", "~> 4.2"
|
25
30
|
end
|
@@ -5,9 +5,9 @@ module ActiveRecord
|
|
5
5
|
|
6
6
|
def self.included(base)
|
7
7
|
base.class_eval do
|
8
|
-
self.column_types.to_a.select { |c| c[1].instance_variable_get('@array') }.map(&:first).each do |
|
8
|
+
self.column_types.to_a.select { |c| c[1].instance_variable_get('@array') }.map(&:first).each do |attr_name|
|
9
9
|
ids_regex = /_ids$/
|
10
|
-
friendly_attr =
|
10
|
+
friendly_attr = attr_name.sub(ids_regex,'')
|
11
11
|
segs = friendly_attr.split('_')
|
12
12
|
segs[-1] = segs[-1].singularize
|
13
13
|
friendly_attr_singular = segs.join('_')
|
@@ -15,16 +15,17 @@ module ActiveRecord
|
|
15
15
|
friendly_attr_plural = segs.join('_')
|
16
16
|
|
17
17
|
obj_convert = ->(obj) do
|
18
|
-
if
|
18
|
+
if attr_name =~ ids_regex && obj.kind_of?(ActiveRecord::Base) and
|
19
|
+
self.column_types[attr_name].type == :integer
|
19
20
|
obj = obj.id
|
20
21
|
end
|
21
22
|
obj
|
22
23
|
end
|
23
24
|
atr = ->(slf) do
|
24
|
-
slf.send
|
25
|
+
slf.send attr_name.to_sym
|
25
26
|
end
|
26
27
|
atr_will_change = ->(slf) do
|
27
|
-
slf.send(:"#{
|
28
|
+
slf.send(:"#{attr_name}_will_change!")
|
28
29
|
end
|
29
30
|
|
30
31
|
define_method :"add_#{friendly_attr_singular}" do |obj|
|
@@ -36,8 +37,15 @@ module ActiveRecord
|
|
36
37
|
end
|
37
38
|
|
38
39
|
define_method :"add_#{friendly_attr_singular}!" do |obj|
|
39
|
-
|
40
|
-
self
|
40
|
+
obj = obj_convert[obj]
|
41
|
+
atr_will_change[self] # seems strange that calling this is needed
|
42
|
+
|
43
|
+
# There are two external issues that block atomic updates to one attribute.
|
44
|
+
# 1. ActiveRecord update_attribute actually updates all attributes that are dirty! This surprised me.
|
45
|
+
# 2. update_column doesn't work on pg arrays for rails < 4.0.4 (which is not yet released)
|
46
|
+
# https://github.com/rails/rails/issues/12261
|
47
|
+
atr[self].push(obj).uniq!
|
48
|
+
self.update_attribute attr_name.to_sym, atr[self]
|
41
49
|
end
|
42
50
|
|
43
51
|
define_method :"add_#{friendly_attr_plural}" do |objs|
|
@@ -49,7 +57,7 @@ module ActiveRecord
|
|
49
57
|
define_method :"remove_#{friendly_attr_singular}" do |obj|
|
50
58
|
obj = obj_convert.call(obj)
|
51
59
|
if atr[self].include?(obj)
|
52
|
-
atr[self].
|
60
|
+
atr[self].delete(obj)
|
53
61
|
atr_will_change[self]
|
54
62
|
end
|
55
63
|
end
|
@@ -59,6 +67,26 @@ module ActiveRecord
|
|
59
67
|
self.save!
|
60
68
|
end
|
61
69
|
|
70
|
+
|
71
|
+
# define basic relational lookup methods
|
72
|
+
# example:
|
73
|
+
# Given wolf_ids is the attribute
|
74
|
+
# Then it will try to define method wolves that retrieves wolf objects
|
75
|
+
if attr_name =~ ids_regex
|
76
|
+
if defined?(friendly_attr_singular.camelize.to_sym) and
|
77
|
+
self.column_types[attr_name].type == :integer
|
78
|
+
begin
|
79
|
+
klass = friendly_attr_singular.camelize.constantize
|
80
|
+
|
81
|
+
# it might be better to define a scope instead
|
82
|
+
define_method friendly_attr_plural.to_sym do
|
83
|
+
klass.where(id: [atr[self]])
|
84
|
+
end
|
85
|
+
rescue NameError
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
62
90
|
end
|
63
91
|
end # base.class_eval
|
64
92
|
end # self.include
|
@@ -0,0 +1,126 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'active_record'
|
3
|
+
|
4
|
+
class Wolf < ActiveRecord::Base
|
5
|
+
end
|
6
|
+
class Chicken < ActiveRecord::Base
|
7
|
+
end
|
8
|
+
|
9
|
+
require 'support/active_record'
|
10
|
+
require 'pry'
|
11
|
+
|
12
|
+
class WolfTracker < ActiveRecord::Base
|
13
|
+
include ActiveRecord::PGArray
|
14
|
+
end
|
15
|
+
|
16
|
+
describe WolfTracker do
|
17
|
+
let(:wolf_tracker) { WolfTracker.create(name: 'Wolfram') }
|
18
|
+
let(:wolfy) { Wolf.create(name: 'Wolfy') }
|
19
|
+
let(:son_of_wolfy) { Wolf.create(name: 'Son of Wolfy') }
|
20
|
+
let(:wolfia) { Wolf.create(name: 'Wolfia') }
|
21
|
+
|
22
|
+
context 'base state' do
|
23
|
+
it "should have empty wolf_ids" do
|
24
|
+
expect(wolf_tracker.wolf_ids).to be_empty
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should have empty pack_names" do
|
28
|
+
expect(wolf_tracker.pack_names).to be_empty
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
context 'method names' do
|
33
|
+
subject { WolfTracker.new }
|
34
|
+
|
35
|
+
it { should respond_to(:add_wolf) }
|
36
|
+
it { should respond_to(:add_wolf!) }
|
37
|
+
it { should respond_to(:add_wolves) }
|
38
|
+
it { should respond_to(:remove_wolf) }
|
39
|
+
it { should respond_to(:remove_wolf!) }
|
40
|
+
|
41
|
+
it { should respond_to(:add_pack_name) }
|
42
|
+
it { should respond_to(:add_pack_name!) }
|
43
|
+
it { should respond_to(:add_pack_names) }
|
44
|
+
it { should respond_to(:remove_pack_name) }
|
45
|
+
it { should respond_to(:remove_pack_name!) }
|
46
|
+
end
|
47
|
+
|
48
|
+
context 'persistence' do
|
49
|
+
|
50
|
+
context "add_<attr_name>" do
|
51
|
+
it "should add_<attr>" do
|
52
|
+
wolf_tracker.add_wolf(wolfy)
|
53
|
+
wolf_tracker.save!
|
54
|
+
wolf_tracker.reload
|
55
|
+
expect(wolf_tracker.wolf_ids).to eq [wolfy.id]
|
56
|
+
end
|
57
|
+
|
58
|
+
it "should add_<attr>! " do
|
59
|
+
wolf_tracker.add_wolf!(wolfy)
|
60
|
+
wolf_tracker.reload
|
61
|
+
expect(wolf_tracker.wolf_ids).to eq [wolfy.id]
|
62
|
+
end
|
63
|
+
|
64
|
+
it "should not update other changed attributes if atomic" do
|
65
|
+
wolf_tracker.name = 'Big Bad Wolf'
|
66
|
+
wolf_tracker.add_wolf!(wolfy)
|
67
|
+
pending "see note where add_<attr_name>! is defined. blocked by external issues"
|
68
|
+
wolf_tracker.reload
|
69
|
+
expect(wolf_tracker.name).to eq 'Wolfram'
|
70
|
+
end
|
71
|
+
|
72
|
+
it "should add with regular integer value" do
|
73
|
+
wolf_tracker.add_wolf(1)
|
74
|
+
wolf_tracker.save!
|
75
|
+
wolf_tracker.reload
|
76
|
+
expect(wolf_tracker.wolf_ids).to eq [1]
|
77
|
+
end
|
78
|
+
|
79
|
+
it "should add with regular string value" do
|
80
|
+
wolf_tracker.add_pack_name('of one')
|
81
|
+
wolf_tracker.save!
|
82
|
+
expect(wolf_tracker.reload.pack_names).to eq ['of one']
|
83
|
+
end
|
84
|
+
|
85
|
+
end # with ActiveRecord object
|
86
|
+
|
87
|
+
context "remove" do
|
88
|
+
before do
|
89
|
+
wolf_tracker.add_wolf!(wolfy)
|
90
|
+
wolf_tracker.reload
|
91
|
+
expect(wolf_tracker.wolf_ids).to eq [wolfy.id]
|
92
|
+
end
|
93
|
+
|
94
|
+
it "should remove_<attr>" do
|
95
|
+
wolf_tracker.remove_wolf(wolfy)
|
96
|
+
wolf_tracker.save!
|
97
|
+
expect(wolf_tracker.reload.wolf_ids).to be_empty
|
98
|
+
end
|
99
|
+
|
100
|
+
it "should remove_<attr>!" do
|
101
|
+
wolf_tracker.remove_wolf!(wolfy.id)
|
102
|
+
expect(wolf_tracker.reload.wolf_ids).to be_empty
|
103
|
+
end
|
104
|
+
end # remove
|
105
|
+
|
106
|
+
it 'should have more specs' do
|
107
|
+
pending 'you\'re not done writing specs'
|
108
|
+
end
|
109
|
+
|
110
|
+
end # persistence
|
111
|
+
|
112
|
+
describe "finder methods" do
|
113
|
+
before do
|
114
|
+
wolf_tracker.add_wolves([wolfy, son_of_wolfy])
|
115
|
+
wolf_tracker.save!
|
116
|
+
end
|
117
|
+
|
118
|
+
it { should respond_to(:wolves) }
|
119
|
+
it { should_not respond_to(:chickens) }
|
120
|
+
|
121
|
+
it "should have a wolves finder method and return a wolf" do
|
122
|
+
expect(wolf_tracker.wolves).to eq [wolfy, son_of_wolfy]
|
123
|
+
end
|
124
|
+
|
125
|
+
end # scopes
|
126
|
+
end
|
data/spec/schema.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# This file is auto-generated from the current state of the database. Instead
|
3
|
+
# of editing this file, please use the migrations feature of Active Record to
|
4
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
5
|
+
#
|
6
|
+
# Note that this schema.rb definition is the authoritative source for your
|
7
|
+
# database schema. If you need to create the application database on another
|
8
|
+
# system, you should be using db:schema:load, not running all the migrations
|
9
|
+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
10
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
11
|
+
#
|
12
|
+
# It's strongly recommended that you check this file into your version control system.
|
13
|
+
|
14
|
+
ActiveRecord::Schema.define(version: 20140227091226) do
|
15
|
+
|
16
|
+
# These are extensions that must be enabled in order to support this database
|
17
|
+
enable_extension "plpgsql"
|
18
|
+
|
19
|
+
create_table "wolf_trackers", force: true do |t|
|
20
|
+
t.string "name"
|
21
|
+
t.integer "wolf_ids", default: [], array: true
|
22
|
+
t.string "pack_names", default: [], array: true
|
23
|
+
t.string "chicken_ids", default: [], array: true # this is intentionally an array of strings
|
24
|
+
end
|
25
|
+
|
26
|
+
add_index "wolf_trackers", ["wolf_ids"], name: "index_wolf_trackers_on_wolf_ids", using: :gin
|
27
|
+
|
28
|
+
create_table "wolves", force: true do |t|
|
29
|
+
t.string "name"
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
+
# Require this file using `require "spec_helper"` to ensure that it is only
|
4
|
+
# loaded once.
|
5
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
6
|
+
|
7
|
+
require 'activerecord/pg_array'
|
8
|
+
|
9
|
+
RSpec.configure do |config|
|
10
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
11
|
+
config.run_all_when_everything_filtered = true
|
12
|
+
config.filter_run :focus
|
13
|
+
|
14
|
+
# Run specs in random order to surface order dependencies. If you find an
|
15
|
+
# order dependency and want to debug it, you can fix the order by providing
|
16
|
+
# the seed, which is printed after each run.
|
17
|
+
# --seed 1234
|
18
|
+
config.order = 'random'
|
19
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'active_record'
|
2
|
+
|
3
|
+
# create a postgresql database:
|
4
|
+
# createdb pg_array_test
|
5
|
+
ActiveRecord::Base.establish_connection adapter: :postgresql, database: 'pg_array_test', username: ENV['PG_DB_USERNAME'], password: ENV['PG_DB_PASSWORD']
|
6
|
+
|
7
|
+
load 'schema.rb'
|
8
|
+
|
9
|
+
RSpec.configure do |config|
|
10
|
+
config.around do |example|
|
11
|
+
ActiveRecord::Base.transaction do
|
12
|
+
example.run
|
13
|
+
raise ActiveRecord::Rollback
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-pg_array
|
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
|
- Sean McCleary
|
@@ -14,16 +14,16 @@ dependencies:
|
|
14
14
|
name: activerecord
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
19
|
+
version: '3.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: '0'
|
26
|
+
version: '3.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -42,16 +42,86 @@ dependencies:
|
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.1'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.1'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.14'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.14'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: pg
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
46
74
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
75
|
+
version: '0.17'
|
48
76
|
type: :development
|
49
77
|
prerelease: false
|
50
78
|
version_requirements: !ruby/object:Gem::Requirement
|
51
79
|
requirements:
|
52
|
-
- - "
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.17'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: pry
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.9'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.9'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: guard
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '2.4'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '2.4'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: guard-rspec
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '4.2'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
53
123
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
124
|
+
version: '4.2'
|
55
125
|
description: A ruby gem that makes working with Postgres arrays in ActiveRecord easier
|
56
126
|
email:
|
57
127
|
- seanmcc@gmail.com
|
@@ -60,13 +130,19 @@ extensions: []
|
|
60
130
|
extra_rdoc_files: []
|
61
131
|
files:
|
62
132
|
- ".gitignore"
|
133
|
+
- ".rspec"
|
63
134
|
- Gemfile
|
135
|
+
- Guardfile
|
64
136
|
- LICENSE.txt
|
65
137
|
- README.md
|
66
138
|
- Rakefile
|
67
139
|
- activerecord-pg_array.gemspec
|
68
140
|
- lib/activerecord/pg_array.rb
|
69
141
|
- lib/activerecord/pg_array/version.rb
|
142
|
+
- spec/lib/pg_array_spec.rb
|
143
|
+
- spec/schema.rb
|
144
|
+
- spec/spec_helper.rb
|
145
|
+
- spec/support/active_record.rb
|
70
146
|
homepage: https://github.com/mrinterweb/activerecord-pg_array
|
71
147
|
licenses:
|
72
148
|
- MIT
|
@@ -87,10 +163,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
163
|
version: '0'
|
88
164
|
requirements: []
|
89
165
|
rubyforge_project:
|
90
|
-
rubygems_version: 2.2.
|
166
|
+
rubygems_version: 2.2.1
|
91
167
|
signing_key:
|
92
168
|
specification_version: 4
|
93
169
|
summary: This gem defines methods in your models for ActiveRecord attributes that
|
94
170
|
use Postgres's arrays
|
95
|
-
test_files:
|
171
|
+
test_files:
|
172
|
+
- spec/lib/pg_array_spec.rb
|
173
|
+
- spec/schema.rb
|
174
|
+
- spec/spec_helper.rb
|
175
|
+
- spec/support/active_record.rb
|
96
176
|
has_rdoc:
|