Class: Offroad::MirrorInfo
Overview
Constant Summary
Offroad::ModelExtensions::OFFROAD_GROUP_MODES, Offroad::ModelExtensions::OFFROAD_VALID_MODES
Class Method Summary
collapse
Instance Method Summary
collapse
#acts_as_offroadable, #acts_as_offroadable?, #offroad_global_data?, #offroad_group_base?, #offroad_group_data?, #offroad_model_state, #safe_to_load_from_cargo_stream?
Class Method Details
.columns ⇒ Object
9
10
11
|
# File 'lib/app/models/offroad/mirror_info.rb', line 9
def self.columns
@columns ||= []
end
|
.new_from_group(group, initial_file = false) ⇒ Object
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/app/models/offroad/mirror_info.rb', line 32
def self.new_from_group(group, initial_file = false)
mode = Offroad::app_online? ? "online" : "offline"
migration_query = "SELECT version FROM schema_migrations ORDER BY version"
migrations = Offroad::group_base_model.connection.select_all(migration_query).map{ |r| r["version"] }
return MirrorInfo.new(
:created_at => Time.now.to_s,
:online_site => Offroad::online_url,
:app => Offroad::app_name,
:app_mode => mode.titleize,
:app_version => Offroad::app_version,
:operating_system => RUBY_PLATFORM,
:generator => "Offroad " + Offroad::VERSION,
:schema_migrations => migrations.join(","),
:initial_file => initial_file
)
end
|
.safe_to_load_from_cargo_stream? ⇒ Boolean
28
29
30
|
# File 'lib/app/models/offroad/mirror_info.rb', line 28
def self.safe_to_load_from_cargo_stream?
true
end
|
Instance Method Details
#save ⇒ Object
49
50
51
|
# File 'lib/app/models/offroad/mirror_info.rb', line 49
def save
raise DataError.new("Cannot save MirrorInfo records")
end
|