Class: GoogleReserveFeedFragment
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- GoogleReserveFeedFragment
- Extended by:
- Enumerize
- Defined in:
- app/models/google_reserve_feed_fragment.rb
Overview
Schema Information
Table name: google_reserve_feed_fragments
id :bigint not null, primary key
failure_reason :text(65535)
processing_status :string(20) default("pending"), not null
upload_file_path :string(500)
created_at :datetime not null
updated_at :datetime not null
restaurant_id :integer not null
Indexes
idx_google_reserve_feed_fragments_upload_file_path (upload_file_path)
idx_grff_created_at (created_at)
idx_grff_restaurant_unique (restaurant_id) UNIQUE
idx_grff_status (processing_status)
idx_grff_status_created (processing_status,created_at)
Instance Method Summary collapse
-
#mark_completed!(upload_file_path) ⇒ Boolean
Marks the fragment as completed with cloud storage file path.
- #mark_failed!(error_message) ⇒ Object
-
#mark_upload_completed! ⇒ Boolean
Marks the uploading status as completed.
-
#mark_upload_failed!(error_message) ⇒ Boolean
Marks the uploading status as failed.
Methods inherited from ApplicationRecord
Instance Method Details
#mark_completed!(upload_file_path) ⇒ Boolean
Marks the fragment as completed with cloud storage file path
34 35 36 37 38 39 40 |
# File 'app/models/google_reserve_feed_fragment.rb', line 34 def mark_completed!(upload_file_path) update!( processing_status: :completed, upload_file_path: upload_file_path, failure_reason: nil, ) end |
#mark_failed!(error_message) ⇒ Object
42 43 44 45 46 47 48 |
# File 'app/models/google_reserve_feed_fragment.rb', line 42 def mark_failed!() update!( processing_status: :failed, failure_reason: &.truncate(65535), upload_file_path: nil, ) end |
#mark_upload_completed! ⇒ Boolean
Marks the uploading status as completed
52 53 54 |
# File 'app/models/google_reserve_feed_fragment.rb', line 52 def mark_upload_completed! update!(uploading_status: :completed) end |
#mark_upload_failed!(error_message) ⇒ Boolean
Marks the uploading status as failed
59 60 61 62 63 64 |
# File 'app/models/google_reserve_feed_fragment.rb', line 59 def mark_upload_failed!() update!( uploading_status: :failed, failure_reason: &.truncate(65535), ) end |