You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 :
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:
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 :
but I feel that would obscure the configuration setting of user_class from the application side.
The text was updated successfully, but these errors were encountered: