Class: Mir::Models::AppSetting
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Mir::Models::AppSetting
- Defined in:
- lib/mir/models/app_setting.rb
Class Method Summary collapse
- .backup_path ⇒ Object
-
.initialize_table(sync_path) ⇒ Object
Builds entries for the variables that will be used by this application.
- .last_indexed_at ⇒ Object
- .last_indexed_at=(val) ⇒ Object
Class Method Details
.backup_path ⇒ Object
15 16 17 |
# File 'lib/mir/models/app_setting.rb', line 15 def self.backup_path where(:name => :sync_path).first.value end |
.initialize_table(sync_path) ⇒ Object
Builds entries for the variables that will be used by this application
9 10 11 12 13 |
# File 'lib/mir/models/app_setting.rb', line 9 def self.initialize_table(sync_path) create(:name => :sync_path, :value => sync_path) create(:name => :install_date, :value => DateTime.now) create(:name => :last_indexed_at, :value => nil) end |
.last_indexed_at ⇒ Object
24 25 26 |
# File 'lib/mir/models/app_setting.rb', line 24 def self.last_indexed_at where(:name => :last_indexed_at).first.value end |
.last_indexed_at=(val) ⇒ Object
19 20 21 22 |
# File 'lib/mir/models/app_setting.rb', line 19 def self.last_indexed_at=(val) record = where(:name => :last_indexed_at).first record.update_attribute(:value, val) end |