mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-12-11 06:35:58 +08:00
changed workflow image name
This commit is contained in:
parent
5583105d8a
commit
f77e0d4a6e
1 changed files with 5 additions and 3 deletions
|
|
@ -13,7 +13,7 @@ class Experiment < ActiveRecord::Base
|
||||||
has_many :my_module_groups, inverse_of: :experiment, dependent: :destroy
|
has_many :my_module_groups, inverse_of: :experiment, dependent: :destroy
|
||||||
has_many :report_elements, inverse_of: :experiment, dependent: :destroy
|
has_many :report_elements, inverse_of: :experiment, dependent: :destroy
|
||||||
|
|
||||||
has_attached_file :workflowimg
|
has_attached_file :workflowimg, styles: { medium: '300x300>' }
|
||||||
validates_attachment_content_type :workflowimg, content_type: /\Aimage\/.*\Z/
|
validates_attachment_content_type :workflowimg, content_type: /\Aimage\/.*\Z/
|
||||||
|
|
||||||
validates :name,
|
validates :name,
|
||||||
|
|
@ -290,8 +290,10 @@ class Experiment < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
file_location = "/tmp/workflowimg_#{Process.pid}.png"
|
file_location = Tempfile.open(['wimg', '.png'],
|
||||||
graph.output(png: file_location)
|
Rails.root.join('tmp'))
|
||||||
|
|
||||||
|
graph.output(png: file_location.path)
|
||||||
|
|
||||||
begin
|
begin
|
||||||
file = File.open(file_location)
|
file = File.open(file_location)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue