Hi all

Help Please!

Question : i have to union two tables named

qareports (1st table)
--------------
id
agency_id

agencies (2nd table)
-------------
id
name

#i have called model from controller by passing some parameter

reports_controller.rb
----------------------------
            if @submited_status.to_i != 2
              @qareports =
@qareports.submitted_reports(@submited_status)
            end

qareport.rb
---------------

  named_scope :unsubmitted_reports, lambda {|*args|
    {
      :conditions => ['locked = 0 and agency_id = ?', (args.first)]
       # so i have to use union agency table here or some where
    }
  }

Please help!

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to