lib/alchemy/controller_actions.rb in alchemy_cms-3.2.0 vs lib/alchemy/controller_actions.rb in alchemy_cms-3.2.1

- old
+ new

@@ -71,9 +71,11 @@ # def current_ability @current_ability ||= begin alchemy_permissions = Alchemy::Permissions.new(current_alchemy_user) Alchemy.registered_abilities.each do |klass| + # Ensure to avoid issues with Rails constant lookup. + klass = "::#{klass}".constantize alchemy_permissions.merge(klass.new(current_alchemy_user)) end if (Object.const_get('::Ability') rescue false) alchemy_permissions.merge(::Ability.new(current_alchemy_user)) end