module SubtradeSearch

Public Class Methods

Public Instance Methods

as_indexed_json(options=[]) click to toggle source

This will return all the relevant rows from the database in json format

# File app/models/concerns/subtrade_search.rb, line 34
    def as_indexed_json(options=[])
      {
        id:       id,
        name:     name,
        description: description,
        alternate_name: alternate_name,
        trade_id: trade_id,
        teachers: teachers,
        mini_description: mini_description,
        trade: {
          _type: 'trade',
          _id:   trade.id,
          name:  trade.name,
          description: trade.description
        },
#        school: {
#          _type: 'school',
#          _id:   school.id,
#          name:  school.name
#        },
        fixxperts: fixxperts.map{ |t|
          {
            _type: 'fixxpert',
            _id: t.id,
            name: t.name
          }
        }
      }
    end
as_json(options={}) click to toggle source

Calls Superclass Method

Calls superclass method
# File app/models/concerns/subtrade_search.rb, line 65
def as_json(options={})
  json = super(options)
  json[:_type] = "subtrade"
  json
end