Skip to content

Instantly share code, notes, and snippets.

@PragTob
Created November 14, 2013 17:20
Show Gist options
  • Select an option

  • Save PragTob/7470687 to your computer and use it in GitHub Desktop.

Select an option

Save PragTob/7470687 to your computer and use it in GitHub Desktop.
When a module (B) is included into another module (M) before that module is included into another class (A), everything works fine and the methods of the second module (B) are accessible. However if it is included after the original module (M) was included in the class (A), the method is not known.
module M
end
module B
def a
puts 'wuhuuu'
end
end
class A
include M
end
M.send(:include, B)
A.new.a # raises no method error
module M
end
module B
def a
puts 'wuhuuu'
end
end
M.send(:include, B)
class A
include M
end
A.new.a # works fine (wuhuuu)
Copy link

ghost commented Nov 14, 2013

SELECT * FROM Sites WHERE ParentId = @id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment