role_authorization 0.4.4 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/role_authorization/user.rb +2 -18
- data/lib/role_authorization/version.rb +1 -1
- metadata +2 -2
@@ -4,24 +4,8 @@ module RoleAuthorization
|
|
4
4
|
base.send :extend, ClassMethods
|
5
5
|
base.send :include, InstanceMethods
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
serialize :serialized_roles
|
10
|
-
end
|
11
|
-
elsif defined?(Mongoid::Attributes)
|
12
|
-
base.class_eval do
|
13
|
-
set_callback(:save, :before) do |user|
|
14
|
-
write_attribute(:serialized_roles, YAML.dump(@serialized_roles || {}))
|
15
|
-
end
|
16
|
-
|
17
|
-
def serialized_roles
|
18
|
-
@serialized_roles ||= (YAML.load(read_attribute(:serialized_roles).to_s) || {})
|
19
|
-
end
|
20
|
-
|
21
|
-
def serialized_roles=(value)
|
22
|
-
@serialized_roles = value
|
23
|
-
end
|
24
|
-
end
|
7
|
+
base.class_eval do
|
8
|
+
serialize :serialized_roles
|
25
9
|
end
|
26
10
|
|
27
11
|
RoleAuthorization::Roles::Manager.user_klass = base
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: role_authorization
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.4.
|
5
|
+
version: 0.4.5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- John 'asceth' Long
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-04-
|
13
|
+
date: 2011-04-20 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|