Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include Dsl into Lotus::Controller directly #7

Closed
wants to merge 1 commit into from

Conversation

haileys
Copy link

@haileys haileys commented Mar 18, 2014

The included method here essentially does what Ruby would already do if Dsl was just included into Lotus::Controller directly.

@jodosha
Copy link
Member

jodosha commented Mar 18, 2014

@charliesome I know what you mean, and thanks for the PR, but I'm afraid it won't work.
If you look at Lotus::Controller::Dsl.included, when the module gets included it extends the including class with its ClassMethods module.

If you include directly Dsl into Controller this one will be extended with ClassMethods, but all the class that will include Lotus::Controller will not inherit that methods. This is the reason why the build failed.

I prepared a simplified version of this use case: https://gist.github.com/jodosha/9617112

@jodosha jodosha closed this Mar 18, 2014
@haileys
Copy link
Author

haileys commented Mar 18, 2014

Ah whoops, I see. Sorry about that bogus PR then!

@haileys haileys deleted the fix-metaprogramming branch March 18, 2014 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants