model/migration for promoted statuses
This commit is contained in:
18
app/models/promotion.rb
Normal file
18
app/models/promotion.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: promotions
|
||||
#
|
||||
# id :bigint(8) not null, primary key
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
# expires_at :datetime
|
||||
# status_id :bigint(8) not null
|
||||
# timeline_id :string
|
||||
# position :integer default(10)
|
||||
#
|
||||
|
||||
class Promotion < ApplicationRecord
|
||||
belongs_to :status
|
||||
|
||||
scope :active, -> { where('expires_at > ?', [Time.now]) }
|
||||
end
|
||||
Reference in New Issue
Block a user