Skip to content

Commit

Permalink
Merge commit 'core/domain-db-system-config' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
cykod committed Jul 28, 2010
2 parents 3b8b437 + fbd5ef5 commit a19a656
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
11 changes: 10 additions & 1 deletion app/models/configuration.rb
Expand Up @@ -113,7 +113,16 @@ def self.fetch_domain_configuration(domain_name)
cfg
end
end


def self.system_module_configuration(mod)
config = DomainModel.active_domain[:domain_database][:config]
if config && config['modules'] && config['modules'][mod]
config['modules'][mod]
else
nil
end
end

# Return the google analytics code
# TODO: move safely into configuration
def self.google_analytics
Expand Down
2 changes: 1 addition & 1 deletion app/models/domain.rb
Expand Up @@ -161,7 +161,7 @@ def get_info
if self.domain_database
info[:domain_database] = self.domain_database.attributes.symbolize_keys
else
info[:domain_database] = {:client_id => self.client_id, :name => self.database, :options => YAML.load_file(self.database_file), :max_client_users => nil, :max_file_storage => nil}
info[:domain_database] = {:client_id => self.client_id, :name => self.database, :options => YAML.load_file(self.database_file), :max_client_users => nil, :max_file_storage => nil, :config => nil}
end

info
Expand Down
1 change: 1 addition & 0 deletions app/models/domain_database.rb
Expand Up @@ -13,6 +13,7 @@ class DomainDatabase < SystemModel
validates_numericality_of :max_file_storage

serialize :options
serialize :config

def before_validation_on_create
self.max_file_storage = DomainDatabase::DEFAULT_MAX_FILE_STORAGE unless self.max_file_storage
Expand Down
10 changes: 10 additions & 0 deletions db/system_migrate/024_add_config_to_domain_databases.rb
@@ -0,0 +1,10 @@

class AddConfigToDomainDatabases < ActiveRecord::Migration
def self.up
add_column :domain_databases, :config, :text
end

def self.down
remove_column :domain_databases, :config
end
end

0 comments on commit a19a656

Please sign in to comment.