lib/role_on.rb in darkhelmet-role_on-0.2.6 vs lib/role_on.rb in darkhelmet-role_on-0.2.7

- old
+ new

@@ -5,9 +5,11 @@ options = c.__send__(:role_on_defaults).merge(options) if (c.methods | c.protected_methods | c.private_methods).include?('role_on_defaults') action = c.params[:action].intern user_roles = c.__send__(:current_user).roles.map(&:name).map(&:intern) restricted_actions = if options.include?(:on) [options[:on]].flatten + elsif options.include?(:only) + [options[:only]].flatten elsif options.include?(:except) c.class.action_methods.to_a.map(&:intern) - [options[:except]].flatten else c.class.action_methods.to_a.map(&:intern) end