module TradeSearch

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/trade_search.rb, line 30
def as_indexed_json(options={})
  {
    id:       id,
    name:     name,
    description: description,
    subtrades: subtrades.map { |c|
      {
        _type: 'subtrade',
        _id:   c.id,
        name:  c.name,
        teachers: c.teachers,
        mini_description: c.mini_description
      }
    },
    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/trade_search.rb, line 55
def as_json(options={})
  json = super(options)
  json[:_type] = "trade"
  json
end