Skip to content

Instantly share code, notes, and snippets.

@cstump
Created July 5, 2013 18:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cstump/5936186 to your computer and use it in GitHub Desktop.
Save cstump/5936186 to your computer and use it in GitHub Desktop.
require 'active_support'
module TestConcern
extend ActiveSupport::Concern
module ClassMethods
def test_class_method
puts "I gots class!"
end
end
def test_instance_method
self.class.test_class_method
end
end
module TestConcern2
extend ActiveSupport::Concern
def test_instance_method
self.class.test_class_method
end
module ClassMethods
def test_class_method
puts "I gots class!"
end
end
end
module TestConcern3
extend ActiveSupport::Concern
module ClassMethods
def test_class_method
puts "I gots class!"
end
end
included do
def test_instance_method
self.class.test_class_method
end
end
end
module TestConcern4
extend ActiveSupport::Concern
included do
def test_instance_method
self.class.test_class_method
end
end
module ClassMethods
def test_class_method
puts "I gots class!"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment