fromage 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
  #
3
3
  module Fromage
4
- VERSION = "0.0.1"
4
+ VERSION = "0.0.2"
5
5
  end
@@ -26,7 +26,7 @@ module Mongoid
26
26
  end
27
27
 
28
28
  def remove_role(role)
29
- self.roles = self.roles.tap {|roles| roles.delete(role)}
29
+ self.roles.tap {|roles| roles.delete(role)}
30
30
  end
31
31
 
32
32
  def remove_role!(role)
@@ -45,7 +45,7 @@ module Mongoid
45
45
  protected
46
46
 
47
47
  def valid_roles?
48
- unless self.roles.all? {|roles| self.class.roles.include? roles }
48
+ if (self.roles - self.class.roles).any?
49
49
  errors.add(:roles, :not_included)
50
50
  end
51
51
  end
@@ -56,7 +56,7 @@ module Mongoid
56
56
  attr_accessor :roles
57
57
 
58
58
  def fromages(*argv)
59
- self.roles = *argv
59
+ self.roles = argv
60
60
 
61
61
  self.roles.each do |role|
62
62
  define_method "#{role}?" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fromage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-01-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &17583480 !ruby/object:Gem::Requirement
16
+ requirement: &12890780 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '2.7'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *17583480
24
+ version_requirements: *12890780
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: activesupport
27
- requirement: &17582960 !ruby/object:Gem::Requirement
27
+ requirement: &12890300 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '3.1'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *17582960
35
+ version_requirements: *12890300
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: mongoid
38
- requirement: &17582400 !ruby/object:Gem::Requirement
38
+ requirement: &12889740 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '2.3'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *17582400
46
+ version_requirements: *12889740
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bson_ext
49
- requirement: &17581860 !ruby/object:Gem::Requirement
49
+ requirement: &12889020 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '1.5'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *17581860
57
+ version_requirements: *12889020
58
58
  description: Role model for mongoid.
59
59
  email: jboyer@af83.com
60
60
  executables: []