Sha256: e135f2f0b22fdfb5679688b84457d9a9e9f1518ecddcdc2d2a4c79ca6b2b14a9

Contents?: true

Size: 718 Bytes

Versions: 2

Compression:

Stored size: 718 Bytes

Contents

# frozen_string_literal: true

require 'active_support'

module Azeroth
  # @api public
  # @author Darthjee
  #
  # Concern for building controller methods for the routes
  #
  # @example (see Resourceable::ClassMethods#resource_for)
  #
  # @see Resourceable::ClassMethods
  module Resourceable
    extend ActiveSupport::Concern

    included do
      rescue_from ActiveRecord::RecordNotFound, with: :not_found
    end

    autoload :Builder, 'azeroth/resourceable/builder'
    autoload :ClassMethods, 'azeroth/resourceable/class_methods'

    private

    # @api private
    # @private
    #
    # returns 404 as HTTP status
    #
    # @return [TrueClass]
    def not_found
      head :not_found
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
azeroth-0.6.5 lib/azeroth/resourceable.rb
azeroth-0.6.4 lib/azeroth/resourceable.rb