Skip to content

Instantly share code, notes, and snippets.

@googya
Created April 16, 2014 05:53
Show Gist options
  • Save googya/10813287 to your computer and use it in GitHub Desktop.
Save googya/10813287 to your computer and use it in GitHub Desktop.
rails concern
require 'active_support/concern'
module Foo
extend ActiveSupport::Concern
included do
p self
def self.do_host_something
:do_host_something
end
end
end
module Bar
extend ActiveSupport::Concern
include Foo
included do
self.send(:do_host_something)
end
end
class Host
include Bar
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment