Module: HackathonManager

Defined in:
lib/hackathon_manager.rb,
lib/hackathon_manager/engine.rb,
lib/hackathon_manager/version.rb

Defined Under Namespace

Classes: Engine

Constant Summary collapse

VERSION =
'0.13.10'.freeze

Class Method Summary collapse

Class Method Details

.field_enabled?(field) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
19
# File 'lib/hackathon_manager.rb', line 16

def self.field_enabled?(field)
  disabled_fields = Rails.configuration.hackathon['disabled_fields'] || []
  !disabled_fields.include?(field.to_s)
end

.reload_config(app) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/hackathon_manager.rb', line 4

def self.reload_config(app)
  hackathon = app.config_for(:hackathon)

  # Applications without a specified config.time_zone will parse
  # this as a string instead of a Time
  if hackathon['last_day_to_apply'].is_a?(String)
    hackathon['last_day_to_apply'] = Time.parse(hackathon['last_day_to_apply'])
  end

  app.config.hackathon = hackathon
end