Class: Gitdocs::Configuration::Config

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/gitdocs/configuration.rb

Overview

NOTE: This record has been kept as a subclass to avoid changing the database table. There are other ways to achieve this, but this seemed most clear for now. [2015-06-26 – acant]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#start_frontend_portBoolean

Returns defaults to true.

Returns:

  • (Boolean)

    defaults to true



42
43
44
45
46
47
48
49
# File 'lib/gitdocs/configuration.rb', line 42

class Config < ActiveRecord::Base
  # @return [Gitdocs::Configuration::Config]
  def self.global
    fail if all.size > 1
    create! if all.empty?
    all.first
  end
end

#web_frontend_portInteger

Returns defaults to 8888.

Returns:

  • (Integer)

    defaults to 8888



42
43
44
45
46
47
48
49
# File 'lib/gitdocs/configuration.rb', line 42

class Config < ActiveRecord::Base
  # @return [Gitdocs::Configuration::Config]
  def self.global
    fail if all.size > 1
    create! if all.empty?
    all.first
  end
end

Class Method Details

.globalGitdocs::Configuration::Config



44
45
46
47
48
# File 'lib/gitdocs/configuration.rb', line 44

def self.global
  fail if all.size > 1
  create! if all.empty?
  all.first
end