diff --git a/app/controllers/experiments_controller.rb b/app/controllers/experiments_controller.rb index 180e03902..c069e53ec 100644 --- a/app/controllers/experiments_controller.rb +++ b/app/controllers/experiments_controller.rb @@ -104,8 +104,6 @@ class ExperimentsController < ApplicationController end log_activity(activity_type) - @experiment.touch(:workflowimg_updated_at) - respond_to do |format| format.json do render json: {}, status: :ok diff --git a/app/services/experiments/generate_workflow_image_service.rb b/app/services/experiments/generate_workflow_image_service.rb index 39a69324f..8d79e76e4 100644 --- a/app/services/experiments/generate_workflow_image_service.rb +++ b/app/services/experiments/generate_workflow_image_service.rb @@ -79,7 +79,6 @@ module Experiments @exp.workflowimg.attach(io: file, filename: File.basename(file.path)) file.close file.unlink - @exp.touch(:workflowimg_updated_at) end end end diff --git a/spec/models/asset_spec.rb b/spec/models/asset_spec.rb index f0eddc284..6bf93fad3 100644 --- a/spec/models/asset_spec.rb +++ b/spec/models/asset_spec.rb @@ -17,10 +17,6 @@ describe Asset, type: :model do it { should have_db_column :id } it { should have_db_column :created_at } it { should have_db_column :updated_at } - it { should have_db_column :file_file_name } - it { should have_db_column :file_content_type } - it { should have_db_column :file_file_size } - it { should have_db_column :file_updated_at } it { should have_db_column :created_by_id } it { should have_db_column :last_modified_by_id } it { should have_db_column :estimated_size } diff --git a/spec/models/experiment_spec.rb b/spec/models/experiment_spec.rb index 23427f757..e83629855 100644 --- a/spec/models/experiment_spec.rb +++ b/spec/models/experiment_spec.rb @@ -27,10 +27,6 @@ describe Experiment, type: :model do it { should have_db_column :restored_on } it { should have_db_column :created_at } it { should have_db_column :updated_at } - it { should have_db_column :workflowimg_file_name } - it { should have_db_column :workflowimg_content_type } - it { should have_db_column :workflowimg_file_size } - it { should have_db_column :workflowimg_updated_at } it { should have_db_column :uuid } end diff --git a/spec/models/temp_file_spec.rb b/spec/models/temp_file_spec.rb index 704213b01..fe62639d9 100644 --- a/spec/models/temp_file_spec.rb +++ b/spec/models/temp_file_spec.rb @@ -17,10 +17,6 @@ describe TempFile, type: :model do it { should have_db_column :session_id } it { should have_db_column :created_at } it { should have_db_column :updated_at } - it { should have_db_column :file_file_name } - it { should have_db_column :file_content_type } - it { should have_db_column :file_file_size } - it { should have_db_column :file_updated_at } end describe 'Validations' do diff --git a/spec/models/tiny_mce_asset_spec.rb b/spec/models/tiny_mce_asset_spec.rb index a86d698af..db00aee42 100644 --- a/spec/models/tiny_mce_asset_spec.rb +++ b/spec/models/tiny_mce_asset_spec.rb @@ -8,10 +8,6 @@ describe TinyMceAsset, type: :model do end describe 'Database table' do - it { should have_db_column :image_file_name } - it { should have_db_column :image_content_type } - it { should have_db_column :image_file_size } - it { should have_db_column :image_updated_at } it { should have_db_column :estimated_size } it { should have_db_column :object_id } it { should have_db_column :object_type } diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 7db2650c0..8c6ff65ff 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -27,10 +27,6 @@ describe User, type: :model do it { should have_db_column :last_sign_in_ip } it { should have_db_column :created_at } it { should have_db_column :updated_at } - it { should have_db_column :avatar_file_name } - it { should have_db_column :avatar_content_type } - it { should have_db_column :avatar_file_size } - it { should have_db_column :avatar_updated_at } it { should have_db_column :confirmation_token } it { should have_db_column :confirmed_at } it { should have_db_column :confirmation_sent_at } diff --git a/spec/models/zip_export_spec.rb b/spec/models/zip_export_spec.rb index 8972e30d6..afe4a1bb1 100644 --- a/spec/models/zip_export_spec.rb +++ b/spec/models/zip_export_spec.rb @@ -17,10 +17,6 @@ describe ZipExport, type: :model do it { should have_db_column :user_id } it { should have_db_column :created_at } it { should have_db_column :updated_at } - it { should have_db_column :zip_file_file_name } - it { should have_db_column :zip_file_content_type } - it { should have_db_column :zip_file_file_size } - it { should have_db_column :zip_file_updated_at } end describe 'Relations' do diff --git a/spec/services/model_importers/test_experiment_data/experiment.json b/spec/services/model_importers/test_experiment_data/experiment.json index ac60279ba..03a6380a3 100644 --- a/spec/services/model_importers/test_experiment_data/experiment.json +++ b/spec/services/model_importers/test_experiment_data/experiment.json @@ -12,11 +12,7 @@ "project_id": 1, "restored_by_id": null, "restored_on": null, - "updated_at": "2019-01-21T13:32:46.473Z", - "workflowimg_content_type": "image/png", - "workflowimg_file_name": "wimg20190121-1-111oj8z.png", - "workflowimg_file_size": 4581, - "workflowimg_updated_at": "2019-01-21T13:31:04.682Z" + "updated_at": "2019-01-21T13:32:46.473Z" }, "my_module_groups": [ { @@ -307,12 +303,8 @@ "created_at": "2019-01-21T13:09:35.615Z", "created_by_id": 1, "estimated_size": 17799, - "file_content_type": null, - "file_file_name": null, - "file_file_size": null, "file_present": true, "file_processing": null, - "file_updated_at": "2019-01-21T13:10:05.392Z", "id": 21, "last_modified_by_id": null, "lock": null, @@ -608,12 +600,8 @@ "created_at": "2019-01-21T12:45:29.138Z", "created_by_id": 1, "estimated_size": 232, - "file_content_type": null, - "file_file_name": null, - "file_file_size": null, "file_present": true, "file_processing": null, - "file_updated_at": "2019-01-21T12:45:28.889Z", "id": 1, "last_modified_by_id": 1, "lock": null, @@ -1087,12 +1075,8 @@ "created_at": "2019-01-21T12:45:32.296Z", "created_by_id": 1, "estimated_size": 1129370, - "file_content_type": null, - "file_file_name": null, - "file_file_size": null, "file_present": true, "file_processing": null, - "file_updated_at": "2019-01-21T12:45:32.237Z", "id": 8, "last_modified_by_id": 1, "lock": null, @@ -1143,12 +1127,8 @@ "created_at": "2019-01-21T12:45:32.847Z", "created_by_id": 1, "estimated_size": 46131, - "file_content_type": null, - "file_file_name": null, - "file_file_size": null, "file_present": true, "file_processing": null, - "file_updated_at": "2019-01-21T12:45:43.655Z", "id": 9, "last_modified_by_id": 1, "lock": null, diff --git a/spec/services/templates_service_spec.rb b/spec/services/templates_service_spec.rb index 7d119500b..051e4de6f 100644 --- a/spec/services/templates_service_spec.rb +++ b/spec/services/templates_service_spec.rb @@ -51,8 +51,8 @@ describe TemplatesService do expect(tmpl_res.name).to eq(demo_res.name) if demo_res.asset expect(tmpl_res.asset.file.attached?).to eq(true) - expect(demo_res.asset.file_file_name) - .to eq(tmpl_res.asset.file_file_name) + expect(demo_res.asset.file_name) + .to eq(tmpl_res.asset.file_name) elsif demo_res.table expect(demo_res.table.contents).to eq(tmpl_res.table.contents) elsif demo_res.result_text @@ -71,8 +71,8 @@ describe TemplatesService do expect(demo_step.name).to eq(tmpl_step.name) expect(demo_step.description).to eq(tmpl_step.description) if demo_step.assets.present? - expect(demo_step.assets.pluck(:file_file_name)) - .to match_array(tmpl_step.assets.pluck(:file_file_name)) + expect(demo_step.assets.map(&:file_name)) + .to match_array(tmpl_step.assets.map(&:file_name)) end tmpl_step.assets.each do |asset| expect(asset.file.attached?).to eq(true)