Hi , presently i have one problem, Ex: i have 6 services 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= User.new(:service_name => 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 end
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??