How to reduce number of queries

Hi ,
presently i have one problem,
i have 6 services
:project_title => ‘Tilte’,
:project_description => ‘Description’,
:created_at => ‘Created At’,
In these way i have 8 services
For each service i would like to give 4 permissions
1)create 2)read 3)write 4) update
all services are having same permissions
But know when i am writing the code

Site::SERVICES.keys.each do |service_key|

@site= =>
Userr::SERVICES[service_key.to_sym],:user_id => partner_id, :user_type
=> “Partner”)

          @site.read_access = true
          @site.create_access = true
          @site.update_access = true


It is raising 8 Queiries for 8 Services and if services number increases
then Number of queries are also increases
So It is not good
I want to find the solution with a single Query !!!
Is it Possible??

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs