Sha256: b7e346efbb8ec205c4637b24c813dda60d4458d3a79129c03722f647cfb6f62a

Contents?: true

Size: 570 Bytes

Versions: 7

Compression:

Stored size: 570 Bytes

Contents

module Tramway::SportSchool
  class Trainer < ::Tramway::Core::ApplicationRecord
    enumerize :degree, in: [ :master_of_sport, :candidate_master_of_sports ]

    mount_uploader :photo, PhotoUploader

    state_machine :view_state, initial: :published do
      state :published
      state :hidden

      event :publish do
        transition hidden: :published
      end

      event :hide do
        transition published: :hidden
      end
    end

    scope :published, -> { where view_state: :published }
    scope :hidden, -> { where view_state: :hidden }
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tramway-sport_school-1.1.3.1 app/models/tramway/sport_school/trainer.rb
tramway-sport_school-1.1.3.trash app/models/tramway/sport_school/trainer.rb
tramway-sport_school-1.1.3 app/models/tramway/sport_school/trainer.rb
tramway-sport_school-1.1.2 app/models/tramway/sport_school/trainer.rb
tramway-sport_school-1.1.1 app/models/tramway/sport_school/trainer.rb
tramway-sport_school-1.1 app/models/tramway/sport_school/trainer.rb
tramway-sport_school-1.0 app/models/tramway/sport_school/trainer.rb