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

Edgeguides#engines.html documentation has broken codes #8583

Closed
ghost opened this issue Dec 21, 2012 · 1 comment
Closed

Edgeguides#engines.html documentation has broken codes #8583

ghost opened this issue Dec 21, 2012 · 1 comment
Labels

Comments

@ghost
Copy link

ghost commented Dec 21, 2012

I caught an error in the codes within the Engine tutorial http://edgeguides.rubyonrails.org/engines.html that needs correcting.
Under section 4.4.1 where you override the user_class getter method inside the Blorgh module in the lib/blorgh.rb , resulting in the user_class method always returning a Class object. That will break the association declaration:

belongs_to :author, class_name: Blorgh.user_class

because Blorgh.user_class here will not be a string but a class, and hence cause a undefined method "match" error.

Even though this could be corrected by adding a to_s :

belongs_to :author, class_name: Blorgh.user_class.to_s

but I feel that would obscure the configuration setting of user_class from the application side.

@steveklabnik
Copy link
Member

/cc @drogus @fxn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants