Sha256: 9d64d6703c517452555eb1b118b462974fb08e75650a2730e1cba0a66c2c2f79

Contents?: true

Size: 1.1 KB

Versions: 4

Compression:

Stored size: 1.1 KB

Contents

class Mumuki::Domain::Organization::Settings < Mumukit::Platform::Model
  include Mumukit::Login::LoginSettingsHelpers

  model_attr_accessor :login_methods,
                      :login_provider,
                      :login_provider_settings,
                      :forum_discussions_minimal_role,
                      :raise_hand_enabled?,
                      :feedback_suggestions_enabled?,
                      :public?,
                      :embeddable?,
                      :immersive?,
                      :forum_enabled?,
                      :report_issue_enabled?,
                      :disabled_from,
                      :in_preparation_until,
                      :gamification_enabled?

  def private?
    !public?
  end

  def login_methods
    @login_methods ||= ['user_pass']
  end

  def forum_discussions_minimal_role
    (@forum_discussions_minimal_role || 'student').to_sym
  end

  def disabled?
    disabled_from.present? && disabled_from.to_datetime < DateTime.now
  end

  def in_preparation?
    in_preparation_until.present? && in_preparation_until.to_datetime > DateTime.now
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
mumuki-domain-7.7.1 lib/mumuki/domain/organization/settings.rb
mumuki-laboratory-7.7.1 vendor/bundle/ruby/2.6.0/bundler/gems/mumuki-domain-cb7a9018bb94/lib/mumuki/domain/organization/settings.rb
mumuki-laboratory-7.7.0 vendor/bundle/ruby/2.6.0/bundler/gems/mumuki-domain-cb7a9018bb94/lib/mumuki/domain/organization/settings.rb
mumuki-domain-7.7.0 lib/mumuki/domain/organization/settings.rb