app/models/product.rb
# Creates hash representation of product for REST services
Creates hash representation of product for REST services
Creates hash representation of product for REST services
def rest_show 
      {
        "id" => self.id, 
        "name" => self.name,
        "description" => self.description, 
        "product_priority" => {
          "id" => self.product_priority_id, 
          "name" => self.priority
        }, 
        "product_type" => {
          "id" => self.product_type_id, 
          "name" => self.type
        },
        "product_state" => {
          "id" => self.product_state_id, 
          "name" => self.state
        }, 
        "groups" => self.rest_groups, 
        "services" => self.rest_services,
        "employees" => self.rest_employees
      }
    end
def rest_show { "id" => self . id , "name" => self . name , "description" => self . description , "product_priority" => { "id" => self . product_priority_id , "name" => self . priority } , "product_type" => { "id" => self . product_type_id , "name" => self . type } , "product_state" => { "id" => self . product_state_id , "name" => self . state } , "groups" => self . rest_groups , "services" => self . rest_services , "employees" => self . rest_employees } end
Creates hash representation of product for REST services
Creates hash representation of product for REST services