lazy_record 0.6.2 → 0.6.3
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/lazy_record/base_module.rb +10 -11
- data/lib/lazy_record/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56bce37d54f4018b548f48e32c8605d63bced313
|
4
|
+
data.tar.gz: 1d1df3c2c2285cd238f49ead0d883897c6a8dc2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0acbf3c1895d7bd1501f7f4558dae2f548273eda3052d0b6f2b4a236232ed5db0b6da310c09634ca340a89f44a24192851d729144c067ab54839998ece509ad7
|
7
|
+
data.tar.gz: 96fea24cfc627e8f88d6ca0dd45c8122daaeef7c5aa6ce40ee345ae51d2e7a47866a54f6314b7e853a732853ccb486169c28268ac5f30113e8d02871f1522955
|
@@ -42,17 +42,17 @@ module LazyRecord
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def ==(other)
|
45
|
-
|
46
|
-
return false if !other.is_a?(self.class) || conditions.empty?
|
47
|
-
conditions.all? { |attr| send(attr) == other.send(attr) }
|
45
|
+
compare(other, :==)
|
48
46
|
end
|
49
47
|
|
50
48
|
def ===(other)
|
49
|
+
compare(other, :===)
|
50
|
+
end
|
51
|
+
|
52
|
+
def compare(other, operator)
|
51
53
|
conditions = set_equality_conditions
|
52
54
|
return false if !other.is_a?(self.class) || conditions.empty?
|
53
|
-
|
54
|
-
conditions.all? { |attr| send(attr) === other.send(attr) }
|
55
|
-
# rubocop:enable Style/CaseEquality
|
55
|
+
conditions.all? { |attr| send(attr).send(operator, other.send(attr)) }
|
56
56
|
end
|
57
57
|
|
58
58
|
def hash
|
@@ -73,11 +73,10 @@ module LazyRecord
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def public_attr_readers_to_s
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
end
|
76
|
+
self.class.send(:public_attr_readers).map do |attr|
|
77
|
+
value = send(attr)
|
78
|
+
"#{attr}: #{stringify_value(value)}"
|
79
|
+
end
|
81
80
|
end
|
82
81
|
|
83
82
|
def associations_to_s
|
data/lib/lazy_record/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lazy_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- M. Simon Borg
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|