Module: Model::Car
Instance Method Summary collapse
Instance Method Details
#for_update ⇒ Object
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 |
#ocr ⇒ Object
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_later ⇒ Object
17 18 19 |
# File 'app/models/ship/model/car.rb', line 17 def ocr_later CarOcrJob.perform_later(self) end |