Module: Model::Car

Extended by:
ActiveSupport::Concern
Included in:
Ship::Car
Defined in:
app/models/ship/model/car.rb

Instance Method Summary collapse

Instance Method Details

#for_updateObject



29
30
31
# File 'app/models/ship/model/car.rb', line 29

def for_update
  broadcast_action_to 'car_new', action: :update, target: 'car_update', partial: 'ship/my/cars/edit_form', locals: { car: self }
end

#ocrObject



21
22
23
24
25
26
27
# File 'app/models/ship/model/car.rb', line 21

def ocr
  r = TencentHelper.registration_ocr(registration.url)
  self.detail = r['FrontInfo']
  self.number = detail['PlateNo'] if detail.is_a?(Hash)
  self.save
  r
end

#ocr_laterObject



17
18
19
# File 'app/models/ship/model/car.rb', line 17

def ocr_later
  CarOcrJob.perform_later(self)
end