Skip to content

Instantly share code, notes, and snippets.

@kaosf
Created June 10, 2015 15:05
Show Gist options
  • Select an option

  • Save kaosf/cc7f3cc068a8eccf599a to your computer and use it in GitHub Desktop.

Select an option

Save kaosf/cc7f3cc068a8eccf599a to your computer and use it in GitHub Desktop.
require 'active_support'
module M1
extend ActiveSupport::Concern
module ClassMethods
def cm
puts 'M1.cm'
end
end
end
module M2
extend M1
end
class C
include M2
end
#C.cm
#xxxx:20:in `<main>': undefined method `cm' for C:Class (NoMethodError)
# WHY?
module M3
extend ActiveSupport::Concern
included do
include M1
end
end
class C2
include M3
end
C2.cm
#=> M1.cm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment