I am looking for a way to create , ( and this is the part I really do
not know) a method a named_scope a somethingâ€¦
that allows me to create an query where I can combine several columns
from different tables.
In plain sql I could create a view and work with it; but I like one of
the concepts of named_scope that
allows me to use it with other to form the query I want.
I wish I could do something like this:
class Master < ActiveRecord::Base
named_scope :selected_fields, :select => “masters.col1, table1s.col3,
I’ve tried few things using joins and include but it seems like it is
always selecting the Master table only.
My playing around had not payed off at all, Iâ€™ve tried using :include,
:select , etcâ€¦
Can someone please give me some advice and maybe a sample code.
The documentation I’ve found is very simplistic.
Thank you very much,