Class: Setting

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/setting.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.[](name) ⇒ Object



4
5
6
7
# File 'app/models/setting.rb', line 4

def self.[] name
  setting = find :first, :conditions => { :name => name.to_s }
  setting ? setting.value : nil
end

.method_missing(name, *args) ⇒ Object



9
10
11
# File 'app/models/setting.rb', line 9

def self.method_missing name, *args
  self[ name ] or raise NoMethodError, "no such setting `#{name}'"
end

Instance Method Details

#to_sObject



2
# File 'app/models/setting.rb', line 2

def to_s; name; end

#xds_register_stored_query_urlObject



23
24
25
26
# File 'app/models/setting.rb', line 23

def xds_register_stored_query_url
  self[:xds_register_stored_query_url] ||
    XDS_REGISTRY_URLS[:register_stored_query]
end

#xds_repository_unique_idObject

FIXME These are here to provide temporary backward compatibility for constant-based global settings. They'll eventually be removed.



15
16
17
18
# File 'app/models/setting.rb', line 15

def xds_repository_unique_id
  self[:xds_repository_unique_id] ||
    XDS_REPOSITORY_UNIQUE_ID
end

#xds_retrieve_document_set_request_urlObject



19
20
21
22
# File 'app/models/setting.rb', line 19

def xds_retrieve_document_set_request_url
  self[:xds_retrieve_document_set_request_url] ||
    XDS_REGISTRY_URLS[:retrieve_document_set_request]
end