[refs #2161] Small changes into platform interface
This commit is contained in:
parent
9a47ae9dc5
commit
ec831014e5
|
@ -88,6 +88,18 @@ class Platform < ActiveRecord::Base
|
||||||
:message => I18n.t("activerecord.attributes.platform.visibility_types.#{visibility}")
|
:message => I18n.t("activerecord.attributes.platform.visibility_types.#{visibility}")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def add_downloads_symlink
|
||||||
|
#raise "Personal platform path #{ symlink_downloads_path } already exists!" if File.exists?(symlink_downloads_path) && File.directory?(symlink_downloads_path)
|
||||||
|
return true if File.exists?(symlink_downloads_path) && File.directory?(symlink_downloads_path)
|
||||||
|
FileUtils.symlink path, symlink_downloads_path
|
||||||
|
end
|
||||||
|
|
||||||
|
def remove_downloads_symlink
|
||||||
|
#raise "Personal platform path #{ symlink_downloads_path } does not exists!" if !(File.exists?(symlink_downloads_path) && File.directory?(symlink_downloads_path))
|
||||||
|
return true if !(File.exists?(symlink_downloads_path) && File.directory?(symlink_downloads_path))
|
||||||
|
FileUtils.rm_rf symlink_downloads_path
|
||||||
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def build_path(dir)
|
def build_path(dir)
|
||||||
|
@ -154,18 +166,6 @@ class Platform < ActiveRecord::Base
|
||||||
"#{ DOWNLOADS_PATH }/#{ self.unixname }"
|
"#{ DOWNLOADS_PATH }/#{ self.unixname }"
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_downloads_symlink
|
|
||||||
#raise "Personal platform path #{ symlink_downloads_path } already exists!" if File.exists?(symlink_downloads_path) && File.directory?(symlink_downloads_path)
|
|
||||||
return true if File.exists?(symlink_downloads_path) && File.directory?(symlink_downloads_path)
|
|
||||||
FileUtils.symlink path, symlink_downloads_path
|
|
||||||
end
|
|
||||||
|
|
||||||
def remove_downloads_symlink
|
|
||||||
#raise "Personal platform path #{ symlink_downloads_path } does not exists!" if !(File.exists?(symlink_downloads_path) && File.directory?(symlink_downloads_path))
|
|
||||||
return true if !(File.exists?(symlink_downloads_path) && File.directory?(symlink_downloads_path))
|
|
||||||
FileUtils.rm_rf symlink_downloads_path
|
|
||||||
end
|
|
||||||
|
|
||||||
def make_owner_rel
|
def make_owner_rel
|
||||||
add_owner owner
|
add_owner owner
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue