Sha256: bc6e3200d19b384fa2c2829035db89b5b82ce1736d5516baf2da6be1cef6c038
Contents?: true
Size: 448 Bytes
Versions: 7
Compression:
Stored size: 448 Bytes
Contents
module NotFound extend ActiveSupport::Concern included do rescue_from Mongoid::Errors::DocumentNotFound do |exception| redirect_or_not_found() end def redirect_or_not_found redirect = Character::Redirect.where(path: request.path).first if redirect redirect_to redirect.destination, status: redirect.type else raise ActionController::RoutingError.new('Not Found') end end end end
Version data entries
7 entries across 7 versions & 1 rubygems