ファイル
btrc-hub/backend/spec/support/event_records.rb
T
2026-11-03 13:37:09 +09:00

16 行
425 B
Ruby

module EventRecords
# Read the database contract without requiring an application Event model.
class EventRow < ActiveRecord::Base
self.table_name = 'events'
end
def event_rows
EventRow.order(:id).map(&:attributes)
end
def create_event! event_type:, created_by_user: nil
EventRow.create!(event_type:, created_by_user_id: created_by_user&.id,
created_at: Time.current)
end
end