[Rails] Is this a use case for an engine or a railtie and why/how?
I have the following files and would like to somehow package them together in a gem however I'm unsure of what I need to create. An engine, a railtie, or something completely different?
/lib/unit.rb
A unit class to handle a common requirement across my models
/app/concerns/unitify_concern.rb
A class method #unitify that I can call in my model which sets up my callbacks, validations, scopes, attribute readers/writers and attr_accessible.
/config/initializers/unitify.rb
Where I've added a few custom Ransack predicates.
I'm open to opinions - it almost seems like too small an amount of code to be worth separating like this. However, I would really like to learn the process of packing a gem for a rails app. I'd also like to get experience testing in isolation and this seems like just the right size place to start.
Thanks,
- FJM
-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/MBkpxpmBXyAJ.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home