Sha256: 405cfdd6d46f31ac124949bea958a8f16b46095a8eb6fc3b838f53b8908f31c6

Contents?: true

Size: 1.39 KB

Versions: 24

Compression:

Stored size: 1.39 KB

Contents

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

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

  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_from=(disabled_from)
    @disabled_from = disabled_from&.to_time
  end

  def in_preparation_until=(in_preparation_until)
    @in_preparation_until = in_preparation_until&.to_time
  end

  def disabled?
    disabled_from.present? && disabled_from < Time.now
  end

  def in_preparation?
    in_preparation_until.present? && in_preparation_until > Time.now
  end
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
mumuki-domain-9.0.2 lib/mumuki/domain/organization/settings.rb
mumuki-domain-9.0.0 lib/mumuki/domain/organization/settings.rb
mumuki-domain-8.6.1 lib/mumuki/domain/organization/settings.rb
mumuki-domain-8.6.0 lib/mumuki/domain/organization/settings.rb
mumuki-domain-8.5.0 lib/mumuki/domain/organization/settings.rb
mumuki-domain-8.4.0 lib/mumuki/domain/organization/settings.rb
mumuki-domain-8.3.1 lib/mumuki/domain/organization/settings.rb
mumuki-domain-8.2.0 lib/mumuki/domain/organization/settings.rb
mumuki-domain-8.1.3 lib/mumuki/domain/organization/settings.rb
mumuki-domain-8.1.2 lib/mumuki/domain/organization/settings.rb
mumuki-domain-8.1.1 lib/mumuki/domain/organization/settings.rb
mumuki-domain-8.1.0 lib/mumuki/domain/organization/settings.rb
mumuki-domain-8.0.0 lib/mumuki/domain/organization/settings.rb
mumuki-domain-7.12.2 lib/mumuki/domain/organization/settings.rb
mumuki-domain-7.12.1 lib/mumuki/domain/organization/settings.rb
mumuki-domain-7.12.0 lib/mumuki/domain/organization/settings.rb
mumuki-domain-7.11.1 lib/mumuki/domain/organization/settings.rb
mumuki-laboratory-7.11.1 vendor/bundle/ruby/2.6.0/bundler/gems/mumuki-domain-c92f2a7212e2/lib/mumuki/domain/organization/settings.rb
mumuki-laboratory-7.11.0 vendor/bundle/ruby/2.6.0/bundler/gems/mumuki-domain-2e15c3330133/lib/mumuki/domain/organization/settings.rb
mumuki-domain-7.11.0 lib/mumuki/domain/organization/settings.rb