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

+ (Object) [](name)



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

+ (Object) method_missing(name, *args)



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

- (Object) to_s



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

def to_s; name; end

- (Object) xds_register_stored_query_url



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

- (Object) xds_repository_unique_id

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

- (Object) xds_retrieve_document_set_request_url



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