lib/authoreyes/authorization/engine.rb in authoreyes-0.1.1 vs lib/authoreyes/authorization/engine.rb in authoreyes-0.2.0
- old
+ new
@@ -87,9 +87,14 @@
# Make sure we're handling all privileges as symbols.
privilege = privilege.is_a?( Array ) ?
privilege.flatten.collect { |priv| priv.to_sym } :
privilege.to_sym
+ # Convert context to symbol as well
+ unless options[:context].nil?
+ options[:context] = options[:context].to_sym
+ end
+
#
# If the object responds to :proxy_reflection, we're probably working with
# an association proxy. Use 'new' to leverage ActiveRecord's builder
# functionality to obtain an object against which we can check permissions.
#