roles_mongo_mapper 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +4 -4
- data/VERSION +1 -1
- data/lib/roles_mongo_mapper/strategy/multi/many_roles.rb +5 -3
- data/lib/roles_mongo_mapper/strategy/single/one_role.rb +5 -4
- data/roles_mongo_mapper.gemspec +14 -14
- metadata +11 -11
data/Rakefile
CHANGED
@@ -9,13 +9,13 @@ begin
|
|
9
9
|
gem.authors = ["Kristian Mandrup"]
|
10
10
|
|
11
11
|
gem.add_development_dependency "rspec", "~> 2.0.0.beta.22"
|
12
|
-
gem.add_development_dependency 'generator-spec', "~> 0.6.
|
12
|
+
gem.add_development_dependency 'generator-spec', "~> 0.6.5"
|
13
13
|
|
14
14
|
gem.add_dependency "mongo_mapper", '~> 0.8.4'
|
15
15
|
gem.add_dependency "activesupport", '~> 3.0.0'
|
16
|
-
gem.add_dependency "require_all", '~> 1.
|
17
|
-
gem.add_dependency "sugar-high", '~> 0.2.
|
18
|
-
gem.add_dependency "roles_generic", '~> 0.2.
|
16
|
+
gem.add_dependency "require_all", '~> 1.2.0'
|
17
|
+
gem.add_dependency "sugar-high", '~> 0.2.11'
|
18
|
+
gem.add_dependency "roles_generic", '~> 0.2.7'
|
19
19
|
gem.add_dependency 'logging_assist', '~> 0.1.3'
|
20
20
|
|
21
21
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
@@ -38,9 +38,11 @@ module RoleStrategy::MongoMapper
|
|
38
38
|
end
|
39
39
|
|
40
40
|
# assign roles
|
41
|
-
def roles=(*
|
42
|
-
|
43
|
-
|
41
|
+
def roles=(*_roles)
|
42
|
+
_roles = get_roles(_roles)
|
43
|
+
return nil if _roles.none?
|
44
|
+
|
45
|
+
role_relations = role_class.find_roles(_roles)
|
44
46
|
self.send("#{role_attribute}=", role_relations)
|
45
47
|
save
|
46
48
|
end
|
@@ -46,10 +46,11 @@ module RoleStrategy::MongoMapper
|
|
46
46
|
end
|
47
47
|
|
48
48
|
# assign roles
|
49
|
-
def roles=(*
|
50
|
-
|
51
|
-
|
52
|
-
|
49
|
+
def roles=(*_roles)
|
50
|
+
_roles = get_roles(_roles)
|
51
|
+
return nil if _roles.none?
|
52
|
+
|
53
|
+
role_relation = role_class.find_role(_roles.first)
|
53
54
|
if role_relation
|
54
55
|
self.send("#{role_attribute}=", role_relation)
|
55
56
|
self.send("#{role_id_attribute}=", role_relation.id)
|
data/roles_mongo_mapper.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{roles_mongo_mapper}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Kristian Mandrup"]
|
12
|
-
s.date = %q{2010-09-
|
12
|
+
s.date = %q{2010-09-23}
|
13
13
|
s.description = %q{Makes it easy to set a role strategy on your User model in MongoMapper}
|
14
14
|
s.email = %q{kmandrup@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -72,31 +72,31 @@ Gem::Specification.new do |s|
|
|
72
72
|
|
73
73
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
74
74
|
s.add_development_dependency(%q<rspec>, ["~> 2.0.0.beta.22"])
|
75
|
-
s.add_development_dependency(%q<generator-spec>, ["~> 0.6.
|
75
|
+
s.add_development_dependency(%q<generator-spec>, ["~> 0.6.5"])
|
76
76
|
s.add_runtime_dependency(%q<mongo_mapper>, ["~> 0.8.4"])
|
77
77
|
s.add_runtime_dependency(%q<activesupport>, ["~> 3.0.0"])
|
78
|
-
s.add_runtime_dependency(%q<require_all>, ["~> 1.
|
79
|
-
s.add_runtime_dependency(%q<sugar-high>, ["~> 0.2.
|
80
|
-
s.add_runtime_dependency(%q<roles_generic>, ["~> 0.2.
|
78
|
+
s.add_runtime_dependency(%q<require_all>, ["~> 1.2.0"])
|
79
|
+
s.add_runtime_dependency(%q<sugar-high>, ["~> 0.2.11"])
|
80
|
+
s.add_runtime_dependency(%q<roles_generic>, ["~> 0.2.7"])
|
81
81
|
s.add_runtime_dependency(%q<logging_assist>, ["~> 0.1.3"])
|
82
82
|
else
|
83
83
|
s.add_dependency(%q<rspec>, ["~> 2.0.0.beta.22"])
|
84
|
-
s.add_dependency(%q<generator-spec>, ["~> 0.6.
|
84
|
+
s.add_dependency(%q<generator-spec>, ["~> 0.6.5"])
|
85
85
|
s.add_dependency(%q<mongo_mapper>, ["~> 0.8.4"])
|
86
86
|
s.add_dependency(%q<activesupport>, ["~> 3.0.0"])
|
87
|
-
s.add_dependency(%q<require_all>, ["~> 1.
|
88
|
-
s.add_dependency(%q<sugar-high>, ["~> 0.2.
|
89
|
-
s.add_dependency(%q<roles_generic>, ["~> 0.2.
|
87
|
+
s.add_dependency(%q<require_all>, ["~> 1.2.0"])
|
88
|
+
s.add_dependency(%q<sugar-high>, ["~> 0.2.11"])
|
89
|
+
s.add_dependency(%q<roles_generic>, ["~> 0.2.7"])
|
90
90
|
s.add_dependency(%q<logging_assist>, ["~> 0.1.3"])
|
91
91
|
end
|
92
92
|
else
|
93
93
|
s.add_dependency(%q<rspec>, ["~> 2.0.0.beta.22"])
|
94
|
-
s.add_dependency(%q<generator-spec>, ["~> 0.6.
|
94
|
+
s.add_dependency(%q<generator-spec>, ["~> 0.6.5"])
|
95
95
|
s.add_dependency(%q<mongo_mapper>, ["~> 0.8.4"])
|
96
96
|
s.add_dependency(%q<activesupport>, ["~> 3.0.0"])
|
97
|
-
s.add_dependency(%q<require_all>, ["~> 1.
|
98
|
-
s.add_dependency(%q<sugar-high>, ["~> 0.2.
|
99
|
-
s.add_dependency(%q<roles_generic>, ["~> 0.2.
|
97
|
+
s.add_dependency(%q<require_all>, ["~> 1.2.0"])
|
98
|
+
s.add_dependency(%q<sugar-high>, ["~> 0.2.11"])
|
99
|
+
s.add_dependency(%q<roles_generic>, ["~> 0.2.7"])
|
100
100
|
s.add_dependency(%q<logging_assist>, ["~> 0.1.3"])
|
101
101
|
end
|
102
102
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 2
|
9
|
+
version: 0.1.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Kristian Mandrup
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-09-
|
17
|
+
date: 2010-09-23 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -45,8 +45,8 @@ dependencies:
|
|
45
45
|
segments:
|
46
46
|
- 0
|
47
47
|
- 6
|
48
|
-
-
|
49
|
-
version: 0.6.
|
48
|
+
- 5
|
49
|
+
version: 0.6.5
|
50
50
|
type: :development
|
51
51
|
version_requirements: *id002
|
52
52
|
- !ruby/object:Gem::Dependency
|
@@ -89,9 +89,9 @@ dependencies:
|
|
89
89
|
- !ruby/object:Gem::Version
|
90
90
|
segments:
|
91
91
|
- 1
|
92
|
-
-
|
92
|
+
- 2
|
93
93
|
- 0
|
94
|
-
version: 1.
|
94
|
+
version: 1.2.0
|
95
95
|
type: :runtime
|
96
96
|
version_requirements: *id005
|
97
97
|
- !ruby/object:Gem::Dependency
|
@@ -105,8 +105,8 @@ dependencies:
|
|
105
105
|
segments:
|
106
106
|
- 0
|
107
107
|
- 2
|
108
|
-
-
|
109
|
-
version: 0.2.
|
108
|
+
- 11
|
109
|
+
version: 0.2.11
|
110
110
|
type: :runtime
|
111
111
|
version_requirements: *id006
|
112
112
|
- !ruby/object:Gem::Dependency
|
@@ -120,8 +120,8 @@ dependencies:
|
|
120
120
|
segments:
|
121
121
|
- 0
|
122
122
|
- 2
|
123
|
-
-
|
124
|
-
version: 0.2.
|
123
|
+
- 7
|
124
|
+
version: 0.2.7
|
125
125
|
type: :runtime
|
126
126
|
version_requirements: *id007
|
127
127
|
- !ruby/object:Gem::Dependency
|