role_authorization 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
@@ -27,7 +27,7 @@ RoleAuthorization::Rules.define :user do
|
|
27
27
|
if options[:resource]
|
28
28
|
check_method = options[:check] || :id
|
29
29
|
resource_instances = controller_instance.instance_eval(&options[:resource])
|
30
|
-
resource_instances = [
|
30
|
+
resource_instances = [resource_instances] unless resource_instances.is_a?(Array)
|
31
31
|
|
32
32
|
resource_instances.map do |resource_instance|
|
33
33
|
controller_instance.current_user.id == resource_instance.try(check_method)
|