fromage 0.0.2 → 0.0.3

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.2"
4
+ VERSION = "0.0.3"
5
5
  end
@@ -15,41 +15,38 @@ module Mongoid
15
15
  scope :all_role, lambda {|*role| all_in(:roles => role)}
16
16
  end
17
17
 
18
- module InstanceMethods
19
- def add_role(*roles)
20
- self.roles += roles
21
- end
18
+ def add_role(*roles)
19
+ self.roles += roles
20
+ end
22
21
 
23
- def add_role!(*args)
24
- self.add_role(*args)
25
- self.save
26
- end
22
+ def add_role!(*args)
23
+ self.add_role(*args)
24
+ self.save
25
+ end
27
26
 
28
- def remove_role(role)
29
- self.roles.tap {|roles| roles.delete(role)}
30
- end
27
+ def remove_role(role)
28
+ self.roles.tap {|roles| roles.delete(role)}
29
+ end
31
30
 
32
- def remove_role!(role)
33
- self.remove_role(role)
34
- self.save
35
- end
31
+ def remove_role!(role)
32
+ self.remove_role(role)
33
+ self.save
34
+ end
36
35
 
37
- def has_role?(role)
38
- self.roles.include? role
39
- end
36
+ def has_role?(role)
37
+ self.roles.include? role
38
+ end
40
39
 
41
- def has_roles?(*args)
42
- args.all? {|role| self.has_role?(role) }
43
- end
40
+ def has_roles?(*args)
41
+ args.all? {|role| self.has_role?(role) }
42
+ end
44
43
 
45
- protected
44
+ protected
46
45
 
47
- def valid_roles?
48
- if (self.roles - self.class.roles).any?
49
- errors.add(:roles, :not_included)
50
- end
46
+ def valid_roles?
47
+ if (self.roles - self.class.roles).any?
48
+ errors.add(:roles, :not_included)
51
49
  end
52
-
53
50
  end
54
51
 
55
52
  module ClassMethods
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.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-03 00:00:00.000000000 Z
12
+ date: 2012-02-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &12890780 !ruby/object:Gem::Requirement
16
+ requirement: &20263540 !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: *12890780
24
+ version_requirements: *20263540
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: activesupport
27
- requirement: &12890300 !ruby/object:Gem::Requirement
27
+ requirement: &20263020 !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: *12890300
35
+ version_requirements: *20263020
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: mongoid
38
- requirement: &12889740 !ruby/object:Gem::Requirement
38
+ requirement: &20262180 !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: *12889740
46
+ version_requirements: *20262180
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bson_ext
49
- requirement: &12889020 !ruby/object:Gem::Requirement
49
+ requirement: &20261320 !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: *12889020
57
+ version_requirements: *20261320
58
58
  description: Role model for mongoid.
59
59
  email: jboyer@af83.com
60
60
  executables: []