relation between lib and model components

8 views
Skip to first unread message

Ben Amsalem

unread,
Apr 21, 2015, 10:35:56 AM4/21/15
to rubyonra...@googlegroups.com
Hi all,
I'm going to create a process that needs to execute a query (via one of my model classes) and then create a file according to the result.
I think I'll locate this process class in my /lib folder, but it means that the lib will have to "know" the relevant model method that executes the query.
What do you think? Can you suggest a "clean" way to do it (when lib and model stay disconnected)? 

Emmanuel Abia

unread,
Apr 21, 2015, 10:57:56 AM4/21/15
to rubyonra...@googlegroups.com

I don't think it is necessary creating any file in /lib since you want to run a process on just one model. Have your process method created in the model class : self.process_method()

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d46cbaa9-8b2f-45b0-bd8d-0aa901e7c14b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages