shiftable 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +4 -4
- data/lib/shiftable/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bad3e2f27677202648655a227fa9f251a595910db9146c9fdb72952657053d3
|
4
|
+
data.tar.gz: 481fede6aa751831cec5c19fe8849b61b081f51cfd4e5aa0a7522ecbb31b38bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 050f4afb2b1ad1e81cd9209dfee0a0f1270745a02bfea84dcaff3914794349c4e6b53b01fb21873731ad05693ae0d02639ee3ade2a0f0d1b5b103fc30952e362
|
7
|
+
data.tar.gz: 5bfc201b247b3082a0a1836c164133f73f59f317de9664934f08bc28a6b3d00140e2c2a3fe0ed7da2a0450fcabb67c66eb28e28c3787403517eadd28fb8d8114
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -153,7 +153,7 @@ class SpaceTreatySignature < ActiveRecord::Base
|
|
153
153
|
# )
|
154
154
|
extend Shiftable::Collection.new(
|
155
155
|
belongs_to: :signatory, has_many: :space_treaty_signature,
|
156
|
-
|
156
|
+
polymorphic: { type: "SpaceFederation", as: :signatory },
|
157
157
|
method_prefix: "space_federation_",
|
158
158
|
before_shift: lambda { |shifting_rel:, shift_to:, shift_from:|
|
159
159
|
# Each item in shifting_rel is an instance of the class where Shiftable::Collection is defined,
|
@@ -171,7 +171,7 @@ class SpaceFederation < ActiveRecord::Base
|
|
171
171
|
has_many :treaty_planets, class_name: "Planet", through: :space_treaty_signatures, as: :signatory
|
172
172
|
has_many :treaty_stations, class_name: "SpaceStation", through: :space_treaty_signatures, as: :signatory
|
173
173
|
def assimilate_from(other_federation)
|
174
|
-
SpaceTreatySignature.
|
174
|
+
SpaceTreatySignature.space_federation_shift_pcx(shift_to: self, shift_from: other_federation)
|
175
175
|
end
|
176
176
|
end
|
177
177
|
|
@@ -189,7 +189,7 @@ class SpaceStation < ActiveRecord::Base
|
|
189
189
|
has_many :treaty_federations, class_name: "SpaceFederation", through: :space_treaty_signatures, as: :signatory
|
190
190
|
has_many :treaty_planets, class_name: "Planet", through: :space_treaty_signatures, as: :signatory
|
191
191
|
end
|
192
|
-
|
192
|
+
```
|
193
193
|
|
194
194
|
### Complete example
|
195
195
|
|
@@ -241,7 +241,7 @@ class SpaceTreatySignature < ActiveRecord::Base
|
|
241
241
|
belongs_to :signatory, polymorphic: true
|
242
242
|
extend Shiftable::Collection.new(
|
243
243
|
belongs_to: :signatory, has_many: :space_treaty_signatures,
|
244
|
-
|
244
|
+
polymorphic: { type: "SpaceFederation", as: :signatory },
|
245
245
|
method_prefix: "space_federation_"
|
246
246
|
)
|
247
247
|
end
|
data/lib/shiftable/version.rb
CHANGED