# == Schema Information # # Table name: events # # id :integer not null, primary key # lang :string default("en") # name :string # shared_scoreboard :boolean # created_at :datetime not null # updated_at :datetime not null # user_id :integer not null # # Indexes # # index_events_on_user_id (user_id) # # Foreign Keys # # user_id (user_id => users.id) # class Event < ApplicationRecord belongs_to :user has_many :contests, dependent: :destroy validates :name, presence: true end