invisible_record 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/invisible_record/helper.rb +4 -1
- data/lib/invisible_record/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: e72f11da44f9f26a2bdb59d3ad4c141a03213c4879283ddb77fa16e0601ada23
|
4
|
+
data.tar.gz: b13ded4cf1304d6fc467c809cf1bc26a5ea3aa5b54e73214253178d26fbec4aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9badeaeb8d1ebb13053bc4112735e8d4f749bc87f248c508a437df2ecc42b387590c933bed268231b289458785932efbc1bc4ec75d2e7580431ef85c19a5e37
|
7
|
+
data.tar.gz: dc93e16661ad86b4191b4a237d51dfd581bf50fe050963b301324282373887048180089424eb8b32eb6b364bf18874ab4a15b30ea3ed8c31efb34c5d739a7764
|
data/Gemfile.lock
CHANGED
@@ -32,7 +32,10 @@ module InvisibleRecord
|
|
32
32
|
def self.define_hidden_attributes(klass, deleted_ts_attr:)
|
33
33
|
klass.attribute_names.each do |attribute|
|
34
34
|
klass.define_method attribute do |*_args|
|
35
|
-
|
35
|
+
protected_attributes = ["id", deleted_ts_attr]
|
36
|
+
protected_attributes.each do |protected_attr_name|
|
37
|
+
return attributes[protected_attr_name] if attribute == protected_attr_name
|
38
|
+
end
|
36
39
|
|
37
40
|
if attributes[deleted_ts_attr].present?
|
38
41
|
nil
|