-
-
Save avbrychak/30a8f343ec1a62a5ac46 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Extensions | |
extend ActiveSupport::Concern | |
included do | |
@@after_end_callbacks = [] | |
end | |
module ClassMethods | |
def after_end(*callbacks) | |
@@after_end_callbacks = callbacks | |
end | |
end | |
end | |
class Model < ActiveRecord::Base | |
include Extensions | |
after_end :foo, :bar | |
def after_end_callbacks | |
@@after_end_callbacks | |
end | |
end | |
puts Model.new.after_end_callbacks # [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment