From 82caac3a176e19246464035a6caaed5139478588 Mon Sep 17 00:00:00 2001 From: Vladimir Krylov Date: Mon, 25 Jan 2016 10:51:29 +0200 Subject: [PATCH] Story#112054829 - fetch file --- app/models/legacy/file.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 app/models/legacy/file.rb diff --git a/app/models/legacy/file.rb b/app/models/legacy/file.rb new file mode 100644 index 000000000..f28a966c4 --- /dev/null +++ b/app/models/legacy/file.rb @@ -0,0 +1,14 @@ +module Legacy + class File < Db + self.table_name = :files + + def self.for_history history_id + sql = %Q{select history.id, files.path, files.name, files.crdate + from history + join action ON action.id=history.action + join files on action.servertrid=files.servertrid + where history.id =#{history_id};} + find_by_sql(sql).to_a + end + end +end \ No newline at end of file