property_sets 3.11.0 → 3.13.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2384aedb2c9f673a4895f5a6e1948ae4ea88c335b2c79985a0c35609ebbce42e
4
- data.tar.gz: dedff61be818879d70d720f3d7bfc545e0b73abeecaf57f678be2dc10a64d5e9
3
+ metadata.gz: d2f1d5ebc0df2d4870989629aafe18d6d49dcc8bacc0d28e8236a04d9591f4ad
4
+ data.tar.gz: 80aff53cee74aa5a8a497df12235d0a58e443ccb1ae5b8129b63d0985b4371f8
5
5
  SHA512:
6
- metadata.gz: 9487f344c48e602edd77c4c36f9e5a4932db43cdc543efc68450d56a1fa433bcade00f1f88ac98ff452e4919865295fdbb9cb4e204ff7edd243ef16a46a28e13
7
- data.tar.gz: a0223c6d67884a49a5165f5db027e02077d83bf094e563595f8e83d3c95c055312d46ec4b036da08c60c55e3e7f90a22b3265a940ff47f2aee4e650e9cb811a3
6
+ metadata.gz: 3467617fbffdc1d18883a4321879e2a8e60e6181c82c7d4f451a58b1714061ea534b4283722b02aba875f6d550dfae0263c23a96caef4449f0f7c4735b88135a
7
+ data.tar.gz: decdf252b3540633a557da69c4d1d9f9905e21fe102947e9250508f48d05ef8f8810e78a468a1d832d8bec04ca7eced850387a176d80a574b2d08618fa6bddf0
@@ -15,7 +15,7 @@ module ActionView
15
15
 
16
16
  def check_box(property, options = {}, checked_value = "1", unchecked_value = "0")
17
17
  options = prepare_options(property, options) do |properties|
18
- properties.send("#{property}?")
18
+ properties.send(:"#{property}?")
19
19
  end
20
20
  template.check_box(object_name, property, options, checked_value, unchecked_value)
21
21
  end
@@ -59,7 +59,7 @@ module ActionView
59
59
  end
60
60
 
61
61
  def fetch_target_object
62
- instance = template.instance_variable_get("@#{object_name}")
62
+ instance = template.instance_variable_get(:"@#{object_name}")
63
63
 
64
64
  throw "No @#{object_name} in scope" if instance.nil?
65
65
  throw "The property_set_check_box only works on models with property set #{property_set}" unless instance.respond_to?(property_set)
@@ -59,7 +59,7 @@ module PropertySets
59
59
  raise "Invalid property key #{key}" if respond_to?(key)
60
60
 
61
61
  # Reports the coerced truth value of the property
62
- define_method "#{key}?" do
62
+ define_method :"#{key}?" do
63
63
  type = property_class.type(key)
64
64
  value = lookup_value(type, key)
65
65
  !["false", "0", "", "off", "n"].member?(value.to_s.downcase)
@@ -72,13 +72,13 @@ module PropertySets
72
72
  end
73
73
 
74
74
  # Assigns a new value to the property
75
- define_method "#{key}=" do |value|
75
+ define_method :"#{key}=" do |value|
76
76
  instance = lookup(key)
77
77
  instance.value = PropertySets::Casting.write(property_class.type(key), value)
78
78
  instance.value
79
79
  end
80
80
 
81
- define_method "#{key}_record" do
81
+ define_method :"#{key}_record" do
82
82
  lookup(key)
83
83
  end
84
84
  end
@@ -113,7 +113,7 @@ module PropertySets
113
113
  if with_protection && record.protected?
114
114
  association_class.logger.warn("Someone tried to update the protected #{name} property to #{property_pairs[name]}")
115
115
  else
116
- send("#{name}=", property_pairs[name])
116
+ send(:"#{name}=", property_pairs[name])
117
117
  end
118
118
  end
119
119
  end
@@ -131,11 +131,11 @@ module PropertySets
131
131
  end
132
132
 
133
133
  def enable(arg)
134
- send("#{arg}=", "1")
134
+ send(:"#{arg}=", "1")
135
135
  end
136
136
 
137
137
  def disable(arg)
138
- send("#{arg}=", "0")
138
+ send(:"#{arg}=", "0")
139
139
  end
140
140
 
141
141
  def build_default(arg)
@@ -170,7 +170,7 @@ module PropertySets
170
170
 
171
171
  owner = proxy_association.owner
172
172
 
173
- instance.send("#{association_class.owner_class_sym}=", owner) if owner.new_record?
173
+ instance.send(:"#{association_class.owner_class_sym}=", owner) if owner.new_record?
174
174
  instance
175
175
  end
176
176
 
@@ -216,7 +216,7 @@ module PropertySets
216
216
  attributes = attributes.reject { |k, _| self.class.delegated_property_set_attributes.include?(k.to_s) }
217
217
  end
218
218
 
219
- super attributes
219
+ super
220
220
  end
221
221
 
222
222
  private
@@ -226,11 +226,11 @@ module PropertySets
226
226
  end
227
227
 
228
228
  def attributes_for_create(attribute_names)
229
- super filter_delegated_property_set_attributes(attribute_names)
229
+ super(filter_delegated_property_set_attributes(attribute_names))
230
230
  end
231
231
 
232
232
  def attributes_for_update(attribute_names)
233
- super filter_delegated_property_set_attributes(attribute_names)
233
+ super(filter_delegated_property_set_attributes(attribute_names))
234
234
  end
235
235
 
236
236
  def filter_delegated_property_set_attributes(attribute_names)
@@ -33,21 +33,21 @@ module PropertySets
33
33
  type = association.association_class.type(new_attr)
34
34
  association.lookup_value(type, new_attr)
35
35
  }
36
- alias_method "#{old_attr}_before_type_cast", old_attr
37
- define_method("#{old_attr}?") { send(setname).send("#{new_attr}?") }
38
- define_method("#{old_attr}=") do |value|
36
+ alias_method :"#{old_attr}_before_type_cast", old_attr
37
+ define_method(:"#{old_attr}?") { send(setname).send(:"#{new_attr}?") }
38
+ define_method(:"#{old_attr}=") do |value|
39
39
  if send(old_attr) != value
40
- send("#{old_attr}_will_change!")
40
+ send(:"#{old_attr}_will_change!")
41
41
  end
42
- send(setname).send("#{new_attr}=", value)
42
+ send(setname).send(:"#{new_attr}=", value)
43
43
  super(value)
44
44
  end
45
45
 
46
- define_method("#{old_attr}_will_change!") do
46
+ define_method(:"#{old_attr}_will_change!") do
47
47
  attribute_will_change!(old_attr)
48
48
  end
49
49
 
50
- define_method("#{old_attr}_changed?") do
50
+ define_method(:"#{old_attr}_changed?") do
51
51
  collection_proxy = send(setname)
52
52
  return false unless collection_proxy.loaded?
53
53
  setting = collection_proxy.lookup_without_default(new_attr)
@@ -51,7 +51,7 @@ module PropertySets
51
51
  @deserialized_value = v
52
52
  write_attribute(:value, v.to_json)
53
53
  else
54
- super(v)
54
+ super
55
55
  end
56
56
  end
57
57
 
@@ -158,7 +158,7 @@ module PropertySets
158
158
  end
159
159
 
160
160
  def owner_class_key_sym
161
- "#{owner_class_sym}_id".to_sym
161
+ :"#{owner_class_sym}_id"
162
162
  end
163
163
  end
164
164
  end
@@ -1,3 +1,3 @@
1
1
  module PropertySets
2
- VERSION = "3.11.0"
2
+ VERSION = "3.13.0"
3
3
  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.11.0
4
+ version: 3.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Morten Primdahl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-08 00:00:00.000000000 Z
11
+ date: 2024-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,20 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '6.0'
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: '7.1'
19
+ version: '6.1'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - ">="
28
25
  - !ruby/object:Gem::Version
29
- version: '6.0'
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '7.1'
26
+ version: '6.1'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: json
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -154,14 +148,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
154
148
  requirements:
155
149
  - - ">="
156
150
  - !ruby/object:Gem::Version
157
- version: '2.7'
151
+ version: '3.1'
158
152
  required_rubygems_version: !ruby/object:Gem::Requirement
159
153
  requirements:
160
154
  - - ">="
161
155
  - !ruby/object:Gem::Version
162
156
  version: '0'
163
157
  requirements: []
164
- rubygems_version: 3.0.3.1
158
+ rubygems_version: 3.5.11
165
159
  signing_key:
166
160
  specification_version: 4
167
161
  summary: Property sets for ActiveRecord.