I’ve got a database table that is shared with another application. It has many columns that I will never use in my application. Is it possible to specify columns to be ignored in the ActiveRecord model?
Usually it’s not too big of a deal, but in this case I’ve got a table with two blobs that I’ll never need joined with another table that has 37 columns (of which I need one).
I suppose I could settle for always using the :select attribute in my finds and associations, but I’d like to just configure it once.
You could use a view in the database rather than look at the source tables directly. This has the advantage that you don’t have to change the code if they add another BLOB column as it wouldn’t be in the view (unless you change the view) and so wouldn’t be picked up.