activerecord-pg_array 0.2 → 0.2.1
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/README.md +4 -0
- data/lib/activerecord/pg_array/version.rb +1 -1
- data/spec/lib/pg_array_spec.rb +7 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f3e5f06664b9e34cf068c13a5da29d89fa8dd11
|
4
|
+
data.tar.gz: f2ea41e56ca03e42e48a9dd9a0768711dfa813de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 565602c3b1d862346e8736bd5718974617d048f70f65c012d783a38308d9beb824bdc6e50816a9c074eb12a0d2f3b7fc92ed05da47ab3bd50bd79d70f1829fb1
|
7
|
+
data.tar.gz: 56ea2f2ecb9d9c94f7933cc6302af951d4439e36fe7ace2f29191df652080595450cb77907a3a7522fb2cc5d4c847cde5c9eb9177eb239c806c5f3c4ebf20d1a
|
data/README.md
CHANGED
@@ -39,6 +39,10 @@ And class:
|
|
39
39
|
```ruby
|
40
40
|
class WolfTracker < ActiveRecord::Base
|
41
41
|
include ActiveRecord::PGArray
|
42
|
+
# if doing anything with the pack_names and passing Wold instances, Wolf#name
|
43
|
+
# will be the attribute used when serializing to pack_names
|
44
|
+
# Using config_array_serializer is optional.
|
45
|
+
config_array_serializer pack_names: {:Wolf => :name}
|
42
46
|
end
|
43
47
|
```
|
44
48
|
|
data/spec/lib/pg_array_spec.rb
CHANGED
@@ -136,6 +136,13 @@ describe WolfTracker do
|
|
136
136
|
expect(wolf_tracker.reload.wolf_ids).to be_empty
|
137
137
|
end
|
138
138
|
|
139
|
+
it "should be able to remove pack_names" do
|
140
|
+
wolf_tracker.add_pack_name wolfy
|
141
|
+
expect(wolf_tracker.pack_names).to eq [wolfy.name]
|
142
|
+
wolf_tracker.remove_pack_name(wolfy)
|
143
|
+
expect(wolf_tracker.pack_names).to eq []
|
144
|
+
end
|
145
|
+
|
139
146
|
context "multiple" do
|
140
147
|
before do
|
141
148
|
wolf_tracker.add_wolf!(son_of_wolfy)
|