From 5475bd6c3ce24cf08d3e168bc6dd53b9618422f7 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Fri, 10 May 2019 23:46:16 +0200 Subject: [PATCH] linting --- config/initializers/_shoryuken.rb | 2 ++ config/initializers/_token.rb | 2 ++ config/initializers/_version.rb | 4 +++- config/initializers/api_pagination.rb | 2 ++ config/initializers/audited.rb | 4 +++- config/initializers/constants.rb | 4 +++- config/initializers/cors.rb | 4 +++- config/initializers/elasticsearch.rb | 4 +++- .../initializers/filter_parameter_logging.rb | 2 ++ config/initializers/flipper.rb | 10 ++++++---- config/initializers/gender_detector.rb | 2 ++ config/initializers/inflections.rb | 2 ++ config/initializers/kaminari_config.rb | 2 ++ config/initializers/lograge.rb | 4 +++- config/initializers/mime_types.rb | 3 ++- config/initializers/sentry.rb | 4 +++- config/initializers/turnout.rb | 4 +++- config/initializers/wrap_parameters.rb | 2 ++ db/migrate/20170807091814_create_all_tables.rb | 18 ++++++++++-------- .../20170807091837_add_columns_to_allocator.rb | 2 ++ .../20170904170626_change_column_in_tables.rb | 2 ++ .../20170908050141_add_deleted_at_column.rb | 2 ++ ...170914055227_convert_to_has_many_through.rb | 6 ++++-- ...0916141643_add_allocator_prefixes_column.rb | 2 ++ db/migrate/20170926083943_add_url_index.rb | 2 ++ db/migrate/20170928202815_addre3data_column.rb | 2 ++ db/migrate/20171109120529_add_aasm_column.rb | 2 ++ .../20171202002420_rename_state_column.rb | 2 ++ .../20171202090754_change_url_column_type.rb | 6 ++++-- db/migrate/20180116230054_add_client_url.rb | 4 +++- db/migrate/20180202063721_add_reason_column.rb | 2 ++ db/migrate/20180306172317_add_json_column.rb | 2 ++ .../20180310064742_landing_page_url_as_text.rb | 6 ++++-- ...180330040550_add_institution_type_column.rb | 2 ++ ...ate_active_storage_tables.active_storage.rb | 2 ++ db/migrate/20180402214555_add_from_column.rb | 2 ++ .../20180505084805_remove_crosscite_column.rb | 2 ++ db/migrate/20180731090122_add_source_column.rb | 2 ++ ...d_last_landing_page_status_result_column.rb | 4 +++- ...81015152049_microseconds_in_time_columns.rb | 4 +++- ...3039_remove_microseconds_in_time_columns.rb | 2 ++ db/migrate/20181023235649_add_focus_area.rb | 2 ++ .../20181102094810_add_schema_attributes.rb | 2 ++ .../20181124062253_add_software_field.rb | 4 +++- ...181129100131_add_landing_page_to_dataset.rb | 2 ++ .../20181130182349_rename_creator_column.rb | 2 ++ .../20181209231736_rename_doi_columns.rb | 2 ++ .../20181216071910_schema_version_index.rb | 2 ++ db/migrate/20190302161113_install_audited.rb | 12 +++++++----- ...90409211358_change_media_url_column_type.rb | 4 +++- .../20190426090046_add_billing_information.rb | 2 ++ db/schema.rb | 2 ++ db/seeds.rb | 2 ++ 53 files changed, 142 insertions(+), 37 deletions(-) diff --git a/config/initializers/_shoryuken.rb b/config/initializers/_shoryuken.rb index adf0485c3..a3a1a9d0b 100644 --- a/config/initializers/_shoryuken.rb +++ b/config/initializers/_shoryuken.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Shoryuken.configure_server do |config| Rails.logger = Shoryuken::Logging.logger Rails.logger.level = Logger.const_get(ENV["LOG_LEVEL"].upcase) diff --git a/config/initializers/_token.rb b/config/initializers/_token.rb index 6676d5dde..2b8eb5722 100644 --- a/config/initializers/_token.rb +++ b/config/initializers/_token.rb @@ -1,2 +1,4 @@ +# frozen_string_literal: true + # generate token for jwt authentication with Profiles service, valid for 12 months ENV['VOLPINO_TOKEN'] = User.generate_token(exp: 3600 * 30 * 12) diff --git a/config/initializers/_version.rb b/config/initializers/_version.rb index 9794a42ab..dd9f9ad3d 100644 --- a/config/initializers/_version.rb +++ b/config/initializers/_version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Lupo class Application g = Git.open(Rails.root) @@ -8,4 +10,4 @@ class Application end REVISION = g.object('HEAD').sha end -end \ No newline at end of file +end diff --git a/config/initializers/api_pagination.rb b/config/initializers/api_pagination.rb index 8c8ae45d3..7d7ccedad 100644 --- a/config/initializers/api_pagination.rb +++ b/config/initializers/api_pagination.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + ApiPagination.configure do |config| config.page_param do |params| params[:page][:number] diff --git a/config/initializers/audited.rb b/config/initializers/audited.rb index b487f771a..560f442d0 100644 --- a/config/initializers/audited.rb +++ b/config/initializers/audited.rb @@ -1,4 +1,6 @@ +# frozen_string_literal: true + Audited.config do |config| config.current_user_method = :authenticated_user config.audit_class = Activity -end \ No newline at end of file +end diff --git a/config/initializers/constants.rb b/config/initializers/constants.rb index e0a3163ed..e6439a213 100644 --- a/config/initializers/constants.rb +++ b/config/initializers/constants.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class IdentifierError < RuntimeError; end RESCUABLE_EXCEPTIONS = [CanCan::AccessDenied, @@ -56,4 +58,4 @@ class IdentifierError < RuntimeError; end "citeproc", "crossref", "codemeta" -] \ No newline at end of file +] diff --git a/config/initializers/cors.rb b/config/initializers/cors.rb index b584542ff..c4163e0f7 100644 --- a/config/initializers/cors.rb +++ b/config/initializers/cors.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Avoid CORS issues when API is called from the frontend app. @@ -13,4 +15,4 @@ headers: :any, methods: [:get, :post, :put, :patch, :delete, :options, :head] end -end \ No newline at end of file +end diff --git a/config/initializers/elasticsearch.rb b/config/initializers/elasticsearch.rb index a2ee09c2d..a5ea09838 100644 --- a/config/initializers/elasticsearch.rb +++ b/config/initializers/elasticsearch.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'faraday_middleware' require 'faraday_middleware/aws_sigv4' @@ -20,4 +22,4 @@ f.adapter :excon end -end \ No newline at end of file +end diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb index 4a994e1e7..7a4f47b4c 100644 --- a/config/initializers/filter_parameter_logging.rb +++ b/config/initializers/filter_parameter_logging.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Configure sensitive parameters which will be filtered from the log file. diff --git a/config/initializers/flipper.rb b/config/initializers/flipper.rb index 96ef6f348..8e5c386db 100644 --- a/config/initializers/flipper.rb +++ b/config/initializers/flipper.rb @@ -1,8 +1,10 @@ -require 'flipper' -require 'flipper/adapters/http' +# frozen_string_literal: true + +require "flipper" +require "flipper/adapters/http" require "active_support/notifications" -require 'active_support/cache' -require 'flipper/adapters/active_support_cache_store' +require "active_support/cache" +require "flipper/adapters/active_support_cache_store" Flipper.configure do |config| config.default do diff --git a/config/initializers/gender_detector.rb b/config/initializers/gender_detector.rb index 879c661c1..788eaa619 100644 --- a/config/initializers/gender_detector.rb +++ b/config/initializers/gender_detector.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'gender_detector' ::NameDetector = GenderDetector.new diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index 23639033d..b6022fd78 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Add new inflection rules using the following format. Inflections # are locale specific, and you may define rules for as many different # locales as you wish. All of these examples are active by default: diff --git a/config/initializers/kaminari_config.rb b/config/initializers/kaminari_config.rb index bc64246ea..3b17fbf16 100644 --- a/config/initializers/kaminari_config.rb +++ b/config/initializers/kaminari_config.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Kaminari.configure do |config| config.default_per_page = 25 config.max_per_page = 1000 diff --git a/config/initializers/lograge.rb b/config/initializers/lograge.rb index 85ea987cf..67c47d226 100644 --- a/config/initializers/lograge.rb +++ b/config/initializers/lograge.rb @@ -1,4 +1,6 @@ -require 'elasticsearch/rails/lograge' +# frozen_string_literal: true + +require "elasticsearch/rails/lograge" Rails.application.configure do config.lograge.enabled = true diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb index 7785cbcfc..083d7c9fc 100644 --- a/config/initializers/mime_types.rb +++ b/config/initializers/mime_types.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # unregister all Mime types, keep only :text Mime::EXTENSION_LOOKUP.map { |i| i.first.to_sym }.each do |f| Mime::Type.unregister(f) @@ -72,4 +74,3 @@ options[:header].to_csv + Array.wrap(obj).map { |o| o.send("csv") }.join("") end - diff --git a/config/initializers/sentry.rb b/config/initializers/sentry.rb index 2f1db77fe..343a9eef6 100644 --- a/config/initializers/sentry.rb +++ b/config/initializers/sentry.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Raven.configure do |config| config.dsn = ENV["SENTRY_DSN"] config.release = "lupo:" + Lupo::Application::VERSION @@ -5,4 +7,4 @@ # ignore 502, 503 and 504 from Elasticsearch config.excluded_exceptions += ['Elasticsearch::Transport::Transport::Errors::BadGateway', 'Elasticsearch::Transport::Transport::Errors::ServiceUnavailable', 'Elasticsearch::Transport::Transport::Errors::GatewayTimeout'] -end \ No newline at end of file +end diff --git a/config/initializers/turnout.rb b/config/initializers/turnout.rb index 38d27da1a..81858ab15 100644 --- a/config/initializers/turnout.rb +++ b/config/initializers/turnout.rb @@ -1,5 +1,7 @@ +# frozen_string_literal: true + Turnout.configure do |config| config.default_maintenance_page = Turnout::MaintenancePage::JSON config.default_allowed_paths = ['^/heartbeat'] config.default_reason = "The site is temporarily down for maintenance. Please check https://status.datacite.org for more information." -end \ No newline at end of file +end diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb index bbfc3961b..2f3c0db47 100644 --- a/config/initializers/wrap_parameters.rb +++ b/config/initializers/wrap_parameters.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # This file contains settings for ActionController::ParamsWrapper which diff --git a/db/migrate/20170807091814_create_all_tables.rb b/db/migrate/20170807091814_create_all_tables.rb index 5622b5f06..7bc7c6ca8 100644 --- a/db/migrate/20170807091814_create_all_tables.rb +++ b/db/migrate/20170807091814_create_all_tables.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class CreateAllTables < ActiveRecord::Migration[5.1] def change create_table "allocator", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| @@ -19,8 +21,8 @@ def change end create_table "allocator_prefixes", primary_key: ["allocator", "prefixes"], force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| - t.integer "allocator", :limit => 8, null: false - t.integer "prefixes", :limit => 8, null: false + t.integer "allocator", limit: 8, null: false + t.integer "prefixes", limit: 8, null: false t.index ["allocator"], name: "FKE7FBD67446EBD781" t.index ["prefixes"], name: "FKE7FBD674AF86A1C7" end @@ -40,15 +42,15 @@ def change t.string "symbol", null: false t.datetime "updated" t.integer "version" - t.integer "allocator", :limit => 8, null: false + t.integer "allocator", limit: 8, null: false t.string "experiments" t.index ["allocator"], name: "FK6695D60546EBD781" t.index ["symbol"], name: "symbol", unique: true end create_table "datacentre_prefixes", primary_key: ["datacentre", "prefixes"], force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| - t.integer "datacentre", :limit => 8, null: false - t.integer "prefixes", :limit => 8, null: false + t.integer "datacentre", limit: 8, null: false + t.integer "prefixes", limit: 8, null: false t.index ["datacentre"], name: "FK13A1B3BA47B5F5FF" t.index ["prefixes"], name: "FK13A1B3BAAF86A1C7" end @@ -63,7 +65,7 @@ def change t.string "last_metadata_status" t.datetime "updated" t.integer "version" - t.integer "datacentre", :limit => 8, null: false + t.integer "datacentre", limit: 8, null: false t.datetime "minted" t.index ["datacentre"], name: "FK5605B47847B5F5FF" t.index ["doi"], name: "doi", unique: true @@ -75,7 +77,7 @@ def change t.datetime "updated" t.string "url", null: false t.integer "version" - t.integer "dataset", :limit => 8, null: false + t.integer "dataset", limit: 8, null: false t.index ["dataset", "updated"], name: "dataset_updated" t.index ["dataset"], name: "FK62F6FE44D3D6B1B" end @@ -85,7 +87,7 @@ def change t.integer "metadata_version" t.integer "version" t.binary "xml", limit: 16777215 - t.integer "dataset", :limit => 8, null: false + t.integer "dataset", limit: 8, null: false t.binary "is_converted_by_mds", limit: 1 t.string "namespace" t.index ["dataset", "metadata_version"], name: "dataset_version" diff --git a/db/migrate/20170807091837_add_columns_to_allocator.rb b/db/migrate/20170807091837_add_columns_to_allocator.rb index 083bc65a4..ba0ad573d 100644 --- a/db/migrate/20170807091837_add_columns_to_allocator.rb +++ b/db/migrate/20170807091837_add_columns_to_allocator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddColumnsToAllocator < ActiveRecord::Migration[5.1] def change add_column :allocator, :description, :string diff --git a/db/migrate/20170904170626_change_column_in_tables.rb b/db/migrate/20170904170626_change_column_in_tables.rb index 62daed860..2f4e8ad69 100644 --- a/db/migrate/20170904170626_change_column_in_tables.rb +++ b/db/migrate/20170904170626_change_column_in_tables.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class ChangeColumnInTables < ActiveRecord::Migration[5.1] def change add_column :dataset, :url, :string diff --git a/db/migrate/20170908050141_add_deleted_at_column.rb b/db/migrate/20170908050141_add_deleted_at_column.rb index 6f73e84e8..ac70c97e5 100644 --- a/db/migrate/20170908050141_add_deleted_at_column.rb +++ b/db/migrate/20170908050141_add_deleted_at_column.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddDeletedAtColumn < ActiveRecord::Migration[5.1] def change add_column :allocator, :deleted_at, :datetime, default: nil diff --git a/db/migrate/20170914055227_convert_to_has_many_through.rb b/db/migrate/20170914055227_convert_to_has_many_through.rb index 58cc315ed..342b1073a 100644 --- a/db/migrate/20170914055227_convert_to_has_many_through.rb +++ b/db/migrate/20170914055227_convert_to_has_many_through.rb @@ -1,13 +1,15 @@ +# frozen_string_literal: true + class ConvertToHasManyThrough < ActiveRecord::Migration[5.1] def up execute "ALTER TABLE `allocator_prefixes` DROP PRIMARY KEY" - add_index :allocator_prefixes, [:allocator, :prefixes], :unique => true + add_index :allocator_prefixes, [:allocator, :prefixes], unique: true add_column :allocator_prefixes, :id, :primary_key add_column :allocator_prefixes, :created, :datetime add_column :allocator_prefixes, :updated, :datetime execute "ALTER TABLE `datacentre_prefixes` DROP PRIMARY KEY" - add_index :datacentre_prefixes, [:datacentre, :prefixes], :unique => true + add_index :datacentre_prefixes, [:datacentre, :prefixes], unique: true add_column :datacentre_prefixes, :id, :primary_key add_column :datacentre_prefixes, :created, :datetime add_column :datacentre_prefixes, :updated, :datetime diff --git a/db/migrate/20170916141643_add_allocator_prefixes_column.rb b/db/migrate/20170916141643_add_allocator_prefixes_column.rb index 4dcecda41..16034be01 100644 --- a/db/migrate/20170916141643_add_allocator_prefixes_column.rb +++ b/db/migrate/20170916141643_add_allocator_prefixes_column.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddAllocatorPrefixesColumn < ActiveRecord::Migration[5.1] def change add_column :datacentre_prefixes, :allocator_prefixes, :integer, limit: 8 diff --git a/db/migrate/20170926083943_add_url_index.rb b/db/migrate/20170926083943_add_url_index.rb index 58d92717d..87a920fcc 100644 --- a/db/migrate/20170926083943_add_url_index.rb +++ b/db/migrate/20170926083943_add_url_index.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddUrlIndex < ActiveRecord::Migration[5.1] def change add_column :dataset, :last_landing_page, :string diff --git a/db/migrate/20170928202815_addre3data_column.rb b/db/migrate/20170928202815_addre3data_column.rb index 87c1e5fa7..e51bfc8af 100644 --- a/db/migrate/20170928202815_addre3data_column.rb +++ b/db/migrate/20170928202815_addre3data_column.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Addre3dataColumn < ActiveRecord::Migration[5.1] def change add_column :datacentre, :re3data, :string diff --git a/db/migrate/20171109120529_add_aasm_column.rb b/db/migrate/20171109120529_add_aasm_column.rb index 1d874ae05..9b7b46fb0 100644 --- a/db/migrate/20171109120529_add_aasm_column.rb +++ b/db/migrate/20171109120529_add_aasm_column.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddAasmColumn < ActiveRecord::Migration[5.1] def self.up add_column :dataset, :state, :string, default: "draft" diff --git a/db/migrate/20171202002420_rename_state_column.rb b/db/migrate/20171202002420_rename_state_column.rb index d50f9c1d2..ed87516e0 100644 --- a/db/migrate/20171202002420_rename_state_column.rb +++ b/db/migrate/20171202002420_rename_state_column.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RenameStateColumn < ActiveRecord::Migration[5.1] def self.up remove_column :dataset, :state diff --git a/db/migrate/20171202090754_change_url_column_type.rb b/db/migrate/20171202090754_change_url_column_type.rb index f4a7abccc..39a6795b0 100644 --- a/db/migrate/20171202090754_change_url_column_type.rb +++ b/db/migrate/20171202090754_change_url_column_type.rb @@ -1,13 +1,15 @@ +# frozen_string_literal: true + class ChangeUrlColumnType < ActiveRecord::Migration[5.1] def up remove_index :dataset, name: "index_dataset_on_url", column: :url change_column :dataset, :url, :text, limit: 65535 - add_index :dataset, :url, name: 'index_dataset_on_url', length: 100 + add_index :dataset, :url, name: "index_dataset_on_url", length: 100 end def down remove_index :dataset, name: "index_dataset_on_url", column: :url change_column :dataset, :url, :string - add_index :dataset, :url, name: 'index_dataset_on_url' + add_index :dataset, :url, name: "index_dataset_on_url" end end diff --git a/db/migrate/20180116230054_add_client_url.rb b/db/migrate/20180116230054_add_client_url.rb index 2f96c1a96..c81987dbc 100644 --- a/db/migrate/20180116230054_add_client_url.rb +++ b/db/migrate/20180116230054_add_client_url.rb @@ -1,6 +1,8 @@ +# frozen_string_literal: true + class AddClientUrl < ActiveRecord::Migration[5.1] def change add_column :datacentre, :url, :text, limit: 65535 - add_index :datacentre, :url, name: 'index_datacentre_on_url', length: 100 + add_index :datacentre, :url, name: "index_datacentre_on_url", length: 100 end end diff --git a/db/migrate/20180202063721_add_reason_column.rb b/db/migrate/20180202063721_add_reason_column.rb index 5c88e5105..ce309e7da 100644 --- a/db/migrate/20180202063721_add_reason_column.rb +++ b/db/migrate/20180202063721_add_reason_column.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddReasonColumn < ActiveRecord::Migration[5.1] def change add_column :dataset, :reason, :string diff --git a/db/migrate/20180306172317_add_json_column.rb b/db/migrate/20180306172317_add_json_column.rb index 5aa699181..42c59f467 100644 --- a/db/migrate/20180306172317_add_json_column.rb +++ b/db/migrate/20180306172317_add_json_column.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddJsonColumn < ActiveRecord::Migration[5.1] def change add_column :dataset, :crosscite, :text, limit: 16777215 diff --git a/db/migrate/20180310064742_landing_page_url_as_text.rb b/db/migrate/20180310064742_landing_page_url_as_text.rb index f1f69d868..796c5612c 100644 --- a/db/migrate/20180310064742_landing_page_url_as_text.rb +++ b/db/migrate/20180310064742_landing_page_url_as_text.rb @@ -1,8 +1,10 @@ +# frozen_string_literal: true + class LandingPageUrlAsText < ActiveRecord::Migration[5.1] def up change_column :dataset, :last_landing_page, :text, limit: 65535 - add_index :dataset, :last_landing_page_status, name: 'index_dataset_on_last_landing_page_status' - add_index :dataset, :last_landing_page_content_type, name: 'index_dataset_on_last_landing_page_content_type' + add_index :dataset, :last_landing_page_status, name: "index_dataset_on_last_landing_page_status" + add_index :dataset, :last_landing_page_content_type, name: "index_dataset_on_last_landing_page_content_type" end def down diff --git a/db/migrate/20180330040550_add_institution_type_column.rb b/db/migrate/20180330040550_add_institution_type_column.rb index 2809a52f5..83cc34ed7 100644 --- a/db/migrate/20180330040550_add_institution_type_column.rb +++ b/db/migrate/20180330040550_add_institution_type_column.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddInstitutionTypeColumn < ActiveRecord::Migration[5.1] def up add_column :allocator, :joined, :date diff --git a/db/migrate/20180330175050_create_active_storage_tables.active_storage.rb b/db/migrate/20180330175050_create_active_storage_tables.active_storage.rb index 5ff0698fb..691a30273 100644 --- a/db/migrate/20180330175050_create_active_storage_tables.active_storage.rb +++ b/db/migrate/20180330175050_create_active_storage_tables.active_storage.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This migration comes from active_storage (originally 20170806125915) class CreateActiveStorageTables < ActiveRecord::Migration[5.2] def change diff --git a/db/migrate/20180402214555_add_from_column.rb b/db/migrate/20180402214555_add_from_column.rb index 914f883d1..7b62cd113 100644 --- a/db/migrate/20180402214555_add_from_column.rb +++ b/db/migrate/20180402214555_add_from_column.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddFromColumn < ActiveRecord::Migration[5.2] def change add_column :dataset, :from, :string diff --git a/db/migrate/20180505084805_remove_crosscite_column.rb b/db/migrate/20180505084805_remove_crosscite_column.rb index 9df72993b..dbde0c6bf 100644 --- a/db/migrate/20180505084805_remove_crosscite_column.rb +++ b/db/migrate/20180505084805_remove_crosscite_column.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemoveCrossciteColumn < ActiveRecord::Migration[5.2] def change remove_column :dataset, :from, :string diff --git a/db/migrate/20180731090122_add_source_column.rb b/db/migrate/20180731090122_add_source_column.rb index 4d8e1ed62..6fedf056b 100644 --- a/db/migrate/20180731090122_add_source_column.rb +++ b/db/migrate/20180731090122_add_source_column.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddSourceColumn < ActiveRecord::Migration[5.2] def change add_column :dataset, :source, :string, limit: 191 diff --git a/db/migrate/20180904161700_add_last_landing_page_status_result_column.rb b/db/migrate/20180904161700_add_last_landing_page_status_result_column.rb index 5847cd40f..69df20d74 100644 --- a/db/migrate/20180904161700_add_last_landing_page_status_result_column.rb +++ b/db/migrate/20180904161700_add_last_landing_page_status_result_column.rb @@ -1,5 +1,7 @@ +# frozen_string_literal: true + class AddLastLandingPageStatusResultColumn < ActiveRecord::Migration[5.2] def change - add_column :dataset, :last_landing_page_status_result, :json, :after => :last_landing_page_status_check + add_column :dataset, :last_landing_page_status_result, :json, after: :last_landing_page_status_check end end diff --git a/db/migrate/20181015152049_microseconds_in_time_columns.rb b/db/migrate/20181015152049_microseconds_in_time_columns.rb index 0ec799a71..80b2a7a4d 100644 --- a/db/migrate/20181015152049_microseconds_in_time_columns.rb +++ b/db/migrate/20181015152049_microseconds_in_time_columns.rb @@ -1,9 +1,11 @@ +# frozen_string_literal: true + class MicrosecondsInTimeColumns < ActiveRecord::Migration[5.2] def up change_column :dataset, :created, :datetime, limit: 3 change_column :dataset, :updated, :datetime, limit: 3 - add_column :dataset, :indexed, :datetime, limit: 3, default: '1970-01-01 00:00:00', null: false + add_column :dataset, :indexed, :datetime, limit: 3, default: "1970-01-01 00:00:00", null: false add_index "dataset", ["created", "indexed", "updated"], name: "index_dataset_on_created_indexed_updated" end diff --git a/db/migrate/20181019133039_remove_microseconds_in_time_columns.rb b/db/migrate/20181019133039_remove_microseconds_in_time_columns.rb index 4e0cf48f8..6249d1702 100644 --- a/db/migrate/20181019133039_remove_microseconds_in_time_columns.rb +++ b/db/migrate/20181019133039_remove_microseconds_in_time_columns.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RemoveMicrosecondsInTimeColumns < ActiveRecord::Migration[5.2] def up change_column :dataset, :created, :datetime diff --git a/db/migrate/20181023235649_add_focus_area.rb b/db/migrate/20181023235649_add_focus_area.rb index fb98c3964..66c463e77 100644 --- a/db/migrate/20181023235649_add_focus_area.rb +++ b/db/migrate/20181023235649_add_focus_area.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddFocusArea < ActiveRecord::Migration[5.2] def up remove_column :allocator, :institution_type, :string, limit: 191 diff --git a/db/migrate/20181102094810_add_schema_attributes.rb b/db/migrate/20181102094810_add_schema_attributes.rb index 93ed12734..042711ab8 100644 --- a/db/migrate/20181102094810_add_schema_attributes.rb +++ b/db/migrate/20181102094810_add_schema_attributes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddSchemaAttributes < ActiveRecord::Migration[5.2] def change add_column :dataset, :creator, :json diff --git a/db/migrate/20181124062253_add_software_field.rb b/db/migrate/20181124062253_add_software_field.rb index 001409c18..fe7c4a4cd 100644 --- a/db/migrate/20181124062253_add_software_field.rb +++ b/db/migrate/20181124062253_add_software_field.rb @@ -1,6 +1,8 @@ +# frozen_string_literal: true + class AddSoftwareField < ActiveRecord::Migration[5.2] def change add_column :datacentre, :software, :string, limit: 191 add_column :datacentre, :description, :text end -end \ No newline at end of file +end diff --git a/db/migrate/20181129100131_add_landing_page_to_dataset.rb b/db/migrate/20181129100131_add_landing_page_to_dataset.rb index 55584af06..0f8b47aed 100644 --- a/db/migrate/20181129100131_add_landing_page_to_dataset.rb +++ b/db/migrate/20181129100131_add_landing_page_to_dataset.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddLandingPageToDataset < ActiveRecord::Migration[5.2] def change add_column :dataset, :landing_page, :json diff --git a/db/migrate/20181130182349_rename_creator_column.rb b/db/migrate/20181130182349_rename_creator_column.rb index 3cdfc0a9d..3ab1d1fea 100644 --- a/db/migrate/20181130182349_rename_creator_column.rb +++ b/db/migrate/20181130182349_rename_creator_column.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RenameCreatorColumn < ActiveRecord::Migration[5.2] def change rename_column :dataset, :creator, :creators diff --git a/db/migrate/20181209231736_rename_doi_columns.rb b/db/migrate/20181209231736_rename_doi_columns.rb index 751fb1009..43560c23c 100644 --- a/db/migrate/20181209231736_rename_doi_columns.rb +++ b/db/migrate/20181209231736_rename_doi_columns.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class RenameDoiColumns < ActiveRecord::Migration[5.2] def change rename_column :dataset, :alternate_identifiers, :identifiers diff --git a/db/migrate/20181216071910_schema_version_index.rb b/db/migrate/20181216071910_schema_version_index.rb index a2250a0cb..e9ad2d987 100644 --- a/db/migrate/20181216071910_schema_version_index.rb +++ b/db/migrate/20181216071910_schema_version_index.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class SchemaVersionIndex < ActiveRecord::Migration[5.2] def change add_index :dataset, [:schema_version] diff --git a/db/migrate/20190302161113_install_audited.rb b/db/migrate/20190302161113_install_audited.rb index 76ba4e6db..00d8dd304 100644 --- a/db/migrate/20190302161113_install_audited.rb +++ b/db/migrate/20190302161113_install_audited.rb @@ -1,6 +1,8 @@ +# frozen_string_literal: true + class InstallAudited < ActiveRecord::Migration[5.2] def self.up - create_table :audits, :force => true do |t| + create_table :audits, force: true do |t| t.column :auditable_id, :integer t.column :auditable_type, :string t.column :associated_id, :integer @@ -10,16 +12,16 @@ def self.up t.column :username, :string t.column :action, :string t.column :audited_changes, :json - t.column :version, :integer, :default => 0 + t.column :version, :integer, default: 0 t.column :comment, :string t.column :remote_address, :string t.column :request_uuid, :string t.column :created_at, :datetime, limit: 3 end - add_index :audits, [:auditable_type, :auditable_id, :version], :name => 'auditable_index' - add_index :audits, [:associated_type, :associated_id], :name => 'associated_index' - add_index :audits, [:user_id, :user_type], :name => 'user_index' + add_index :audits, [:auditable_type, :auditable_id, :version], name: "auditable_index" + add_index :audits, [:associated_type, :associated_id], name: "associated_index" + add_index :audits, [:user_id, :user_type], name: "user_index" add_index :audits, :request_uuid add_index :audits, :created_at end diff --git a/db/migrate/20190409211358_change_media_url_column_type.rb b/db/migrate/20190409211358_change_media_url_column_type.rb index 23513c269..55387b15e 100644 --- a/db/migrate/20190409211358_change_media_url_column_type.rb +++ b/db/migrate/20190409211358_change_media_url_column_type.rb @@ -1,7 +1,9 @@ +# frozen_string_literal: true + class ChangeMediaUrlColumnType < ActiveRecord::Migration[5.2] def up change_column :media, :url, :text, limit: 65535 - add_index :media, :url, name: 'index_media_on_url', length: 100 + add_index :media, :url, name: "index_media_on_url", length: 100 end def down diff --git a/db/migrate/20190426090046_add_billing_information.rb b/db/migrate/20190426090046_add_billing_information.rb index 8d7e6da68..385ac6f4c 100644 --- a/db/migrate/20190426090046_add_billing_information.rb +++ b/db/migrate/20190426090046_add_billing_information.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddBillingInformation < ActiveRecord::Migration[5.2] def up add_column :allocator, :billing_information, :json diff --git a/db/schema.rb b/db/schema.rb index 3ba14fe4c..40aa9887c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. diff --git a/db/seeds.rb b/db/seeds.rb index 1beea2acc..ebd18895a 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). #