Created
July 17, 2017 16:43
-
-
Save kirs/7a7ae0339a4fd78d27f7b4f429587c87 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
require 'bundler/setup' | |
require 'active_support/all' | |
module Feature | |
extend ActiveSupport::Concern | |
included do |base| | |
puts "#{base} included Feature" | |
end | |
end | |
class AbstractRecord | |
include Feature | |
end | |
class MyRecord < AbstractRecord | |
include Feature | |
end | |
# output: | |
# AbstractRecord included Feature | |
module Feature | |
def self.included(base) | |
puts "#{base} included Feature" | |
end | |
end | |
class AbstractRecord | |
include Feature | |
end | |
class MyRecord < AbstractRecord | |
include Feature | |
end | |
# output: | |
# AbstractRecord included Feature | |
# MyRecord included Feature |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment