lib/activity_notification/rails/routes.rb in activity_notification-1.2.1 vs lib/activity_notification/rails/routes.rb in activity_notification-1.3.0
- old
+ new
@@ -202,30 +202,34 @@
false
end
# Create options fo routing
# @api private
+ # @todo Check resources if it includes target module
+ # @todo Check devise configuration in model
+ # @todo Support other options like :as, :path_prefix, :path_names ...
+ #
# @param [Symbol] resource Name of the resource model
# @return [Boolean] Whether action path is ignored
def create_options(resource, options = {}, except_actions = [])
- #TODO check resources if it includes target module
+ # Check resources if it includes target module
resources_name = resource.to_s.pluralize.underscore
options[:model] ||= resources_name.to_sym
if options[:with_devise].present?
options[:controller] ||= "activity_notification/#{resources_name}_with_devise"
options[:as] ||= resources_name
- #TODO check devise configuration in model
+ # Check devise configuration in model
options[:devise_defaults] = { devise_type: options[:with_devise].to_s }
else
options[:controller] ||= "activity_notification/#{resources_name}"
options[:devise_defaults] = {}
end
(options[:except] ||= []).concat(except_actions)
if options[:with_subscription].present?
options[:subscription_option] = (options[:with_subscription].is_a?(Hash) ? options[:with_subscription] : {})
.merge(with_devise: options[:with_devise])
end
- #TODO other options like :as, :path_prefix, :path_names ...
+ # Support other options like :as, :path_prefix, :path_names ...
options
end
end
end