I have several hairy SQL queries that join and select columns from
multiple tables. The standard AR pattern:
has rules about which attributes in MyModel are preserved and which
attributes are added as a result of the query. The problem is that the
dynamic finders and accessor methods from MyModel can intermingle and
sometimes shadow attributes returned as a result of the query.
It seems you could create a vanilla model:
class Vanilla < ActiveRecord::Base
whose sole job is to act as a container for find_by_sql() queries, e.g.:
Can you think of any flaws to this approach (before I go and create a
new git branch :)?