Sha256: 02365f5ae1e06bd5c76bcb73cc93916df86e1d69796d78b03daed3c706796e4d

Contents?: true

Size: 593 Bytes

Versions: 19

Compression:

Stored size: 593 Bytes

Contents

module Superstore
  module Callbacks
    extend ActiveSupport::Concern

    included do
      extend ActiveModel::Callbacks
      include ActiveModel::Validations::Callbacks

      define_model_callbacks :save, :create, :update, :destroy
    end

    def destroy #:nodoc:
      run_callbacks(:destroy) { super }
    end

    private
      def write(*args) #:nodoc:
        run_callbacks(:save) { super }
      end

      def create_self #:nodoc:
        run_callbacks(:create) { super }
      end

      def update_self(*) #:nodoc:
        run_callbacks(:update) { super }
      end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
superstore-2.4.4 lib/superstore/callbacks.rb
superstore-2.4.3 lib/superstore/callbacks.rb
superstore-2.4.2 lib/superstore/callbacks.rb
superstore-2.4.1 lib/superstore/callbacks.rb
superstore-2.4.0 lib/superstore/callbacks.rb
superstore-2.3.0 lib/superstore/callbacks.rb
superstore-2.2.0 lib/superstore/callbacks.rb
superstore-2.1.3 lib/superstore/callbacks.rb
superstore-2.1.2 lib/superstore/callbacks.rb
superstore-2.1.1 lib/superstore/callbacks.rb
superstore-2.1.0 lib/superstore/callbacks.rb
superstore-2.0.1 lib/superstore/callbacks.rb
superstore-2.0.0 lib/superstore/callbacks.rb
superstore-1.2.0 lib/superstore/callbacks.rb
superstore-1.1.4 lib/superstore/callbacks.rb
superstore-1.1.3 lib/superstore/callbacks.rb
superstore-1.1.2 lib/superstore/callbacks.rb
superstore-1.1.1 lib/superstore/callbacks.rb
superstore-1.1.0 lib/superstore/callbacks.rb