rolistic 1.0.0 → 1.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7356f50bf28651e088a35eac974c6c6d9a62472eaca0e1e766b17e4e449b9a1d
4
- data.tar.gz: 591b0172a18126f9875da07938dc6fbb9576bd10fb6c6c7c221b7c3388dbb963
3
+ metadata.gz: 1a4602b3b7be871f6ff0a39e5fbac10ff31dd80e61c234460ef3a32346123fda
4
+ data.tar.gz: 3f16800397a6ed3f49e8c165a79d3c555e21e6803f21ac64833f1bd1011bb1e5
5
5
  SHA512:
6
- metadata.gz: 57c3804494ee93ea246b43f4c1d34eab2b096eeeb093a6d0b1910b210fabf8d62835d394a9030b1582036b581cd820c1d6243a14668497ff85893e9b2ac69c56
7
- data.tar.gz: e8efb268bb508d0568b25d4c5dc44673ba85caef2803e257489e16827bc665b56850fcee7c4981d076a6a4163bab452dfd7798d6d1b36fca9cbe8be81e03a146
6
+ metadata.gz: b9d01d4c3797437da4cc263136edaed33c333b8f199e5ca40fa4a463ef9b914a077128dc961ac8c791712ba9f29f3fde5b7534978417d7d5d6467b345baf85a8
7
+ data.tar.gz: 902a4f997767abb7c97f9fcd85326143b96f41a9d508d55f16e46e4b1410962be876b1dc557b9b4664fb0610da15728684d9406d40ad4cd6e366177d920c0bd5
@@ -1,3 +1,3 @@
1
1
  module Rolistic
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
data/lib/rolistic.rb CHANGED
@@ -29,6 +29,18 @@ module Rolistic
29
29
  name == self.class.default
30
30
  end
31
31
 
32
+ # roles are value objects: abilities are derived from the class and name, so
33
+ # two roles of the same class and name are equal. This lets ActiveRecord see
34
+ # assigning an equivalent role as no change.
35
+ def ==(other)
36
+ other.class == self.class && other.name == name
37
+ end
38
+ alias_method :eql?, :==
39
+
40
+ def hash
41
+ [self.class, name].hash
42
+ end
43
+
32
44
  def inspect
33
45
  "#<#{self.class} :#{to_s}>"
34
46
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rolistic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carl Zulauf