# == Schema Information # # Table name: order_histories # # id :bigint(8) unsigned, not null, primary key # order_id :bigint(8) not null # status :integer not null # created_at :datetime # created_by :integer # # Order change status history class OrderHistory < ApplicationRecord belongs_to :order scope :by_create_desc, -> { order(created_at: :desc) } scope :by_create_asc, -> { order(created_at: :asc) } end