lib/janus/controllers/internal_helpers.rb in janus-0.9.0 vs lib/janus/controllers/internal_helpers.rb in janus-0.9.1

- old
+ new

@@ -41,9 +41,17 @@ # Alias for janus_scope. def resource_name janus_scope end + def resource_authentication_params + if params.respond_to?(:permit) + params.require(janus_scope).permit(*resource_class.authentication_keys) + else + params[janus_scope].slice(*resource_class.authentication_keys) + end + end + # Returns the `UserMailer` class (or `AdminMailer` or whatever) as detected # by janus_scope. def mailer_class @mailer_class ||= (janus_scope.camelize + 'Mailer').constantize end