lib/permissive/permission_definition.rb in permissive-0.2.7.alpha vs lib/permissive/permission_definition.rb in permissive-0.2.8.alpha
- old
+ new
@@ -21,11 +21,11 @@
attempted_scope = scope.to_s.singularize.classify
model_module = model.name.to_s.split('::')
model_module.pop
model_module = model_module.join('::')
if (model_module.blank? ? Object : Object.const_get(model_module)).const_defined?(attempted_scope)
- [model_module, attempted_scope].join('::')
+ [model_module, attempted_scope].reject(&:blank?).join('::')
else
scope.to_s.classify
end
end
@@ -147,6 +147,6 @@
def roles
@roles ||= {}
end
end
-end
\ No newline at end of file
+end