I am a beginner to RoR and could use some guidance. I have been trolling this stackoverflow answer religiously these past few days.
Rails engines extending functionality
But the error that keeps being thrown is: 'undefined method join'
I have an abstract model called OrderError. OrderErrorDetails is my other model , which is used to actually store data within the database. The OrderError abstract model is here solely to provide functionality, not to store anything. :
module MyEngine
class OrderError
self.abstract_class = true
has_one :order_error_detail
def self.new
#my_code
end
end
end
So what I tried instead of requiring (stack overflow link above) was placing the following code to my app's Order Model:
order_error MyEngine::OrderError.new
When I did this, I was able to successfully access my engines OrderError model. However, the error I now get is: The method .order() must contain arguments.
My hope is that once the engine is mounted into an app, I can call my engines various methods. This will provide the user of the engine some default functionality.
Should I be using abstract classes to begin with? In my mind the answer is yes, because my abstract model's only purpose is to provide methods that can be used. If so, how does one efficiently provide access to those methods?