[LRUG] Rails and DB Views

Ed James (Alt) ed.james.spam at gmail.com
Fri Jan 17 03:20:12 PST 2014


Hi all  

Is anyone using db views in a Rails app? If so, maybe you can help.  

My issue lies more around the management of the views, rather than using them in the app. I’ve done this before in a previous project but I don’t have access to that codebase anymore and I can’t remember what the hell I did.
How do you make ActiveRecord recognise the view and exclude it from the schema.rb file?
I seem to remember keeping the views as .sql files which were executed after a migration (by enhancing the db:migrate task). Any variations on this?

The only gem I’ve managed to find is this one: https://github.com/railsware/db_structure_ext/tree/master/lib/db_structure_ext
Seems very old though and this seems like something which doesn’t need a gem. I know we didn’t use one previously.

Unfortunately using the word “view” in search criteria is not very useful ;)

Thanks,
Ed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20140117/e598d6de/attachment-0003.html>


More information about the Chat mailing list