property_sets 3.5.4 → 3.5.5
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/lib/property_sets/delegator.rb +5 -6
- data/lib/property_sets/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7ec20448b7611d9a88bad99dd6054acb756b53b4a1245566140c1c69d9fddf83
|
|
4
|
+
data.tar.gz: 2f1f2ba401def86c3c0b417002c02f7242b44150d4f98ee329b0d0cc816d0030
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9da8220c3444cd8f71daafa64172bffcd17efb0f7b60b98ced8f4e8a5193ad7defbcbb8e13be1c914fc01c756c4f147316fe42af833e9edd85eb80032ff86144
|
|
7
|
+
data.tar.gz: 1e70f7eb188f60600ff770b5b0034e43de5575b471b88194b6c736d3eeabe13319c1281e65c6512ab12958e0c31079f4961fe0d1b976666ceccc12a1bbdbfd3b
|
|
@@ -20,7 +20,10 @@ module PropertySets
|
|
|
20
20
|
def delegate_to_property_set(setname, mappings)
|
|
21
21
|
raise "Second argument must be a Hash" unless mappings.is_a?(Hash)
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
unless respond_to?(:delegated_property_set_attributes)
|
|
24
|
+
class_attribute :delegated_property_set_attributes
|
|
25
|
+
end
|
|
26
|
+
self.delegated_property_set_attributes ||= []
|
|
24
27
|
|
|
25
28
|
mappings.each do |old_attr, new_attr|
|
|
26
29
|
self.delegated_property_set_attributes << old_attr.to_s
|
|
@@ -60,13 +63,9 @@ module PropertySets
|
|
|
60
63
|
# These are not database columns and should not be included in queries but
|
|
61
64
|
# using the attributes API is the only way to track changes in the main model
|
|
62
65
|
if respond_to?(:user_provided_columns)
|
|
63
|
-
self.user_provided_columns.reject!{|k,_|
|
|
66
|
+
self.user_provided_columns.reject!{|k,_| delegated_property_set_attributes.include?(k.to_s) }
|
|
64
67
|
end
|
|
65
68
|
end
|
|
66
|
-
|
|
67
|
-
def delegated_property_set_attributes
|
|
68
|
-
@delegated_property_set_attributes
|
|
69
|
-
end
|
|
70
69
|
end
|
|
71
70
|
end
|
|
72
71
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: property_sets
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.5.
|
|
4
|
+
version: 3.5.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Morten Primdahl
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-07-
|
|
11
|
+
date: 2020-07-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|