Extending a Model from an Engine in your Rails App

25 October 2010

While working on the Rails 3 upgrade of the SaaS Rails Kit (which is available for customers, BTW), I moved most of the guts of the Kit into a plugin (engine) to make it easier to integrate into pre-existing apps. Then, as I was working on integrating the Kit into a client app, I ran into a situation where I wanted to extend one of the models provided in the plugin in the app, since this was a project-specific tweak. I mixed together a couple of suggestions that I found on there on the internets to come up with this:

That is added to config/initializers, and it simply adds a couple of scopes to the model that this project needed (but that I'm not sure other RailsKit customers would care about).

Does that look like the best approach? Or is there a better way to extend models that are defined in a plugin?



Looking for help again

18 October 2010

The work keeps coming in, and I need another pair of hands to get it all done. So, if you're looking to pick up some part time dev work, and you know your way around a Rails app, apply for the gig here:

http://tesly.catchthebest.com/apply/e3d3/b17a

You don't need to be local to Seattle (though that would be a plus), but you do need to be generally available from 10-3 US/Pacific so we can chat in Campfire about projects or do the occasional screen sharing.