Sha256: 2c5d189f43abc9a11e8d492d45fbb6d2a7813c49914f90964c04c057215d6613

Contents?: true

Size: 473 Bytes

Versions: 1

Compression:

Stored size: 473 Bytes

Contents

module Toy
  module Callbacks
    extend ActiveSupport::Concern

    included do
      extend ActiveModel::Callbacks
      define_model_callbacks :save, :create, :update, :destroy
    end

    def save(options={})
      run_callbacks(:save) { super }
    end

    def destroy
      run_callbacks(:destroy) { super }
    end

    private

    def create
      run_callbacks(:create) { super }
    end

    def update
      run_callbacks(:update) { super }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
toystore-0.13.2 lib/toy/callbacks.rb