Apply Layout/LineLength rubocop rule

Note we're excluding a few files:

* Configuration files that weren't generated by us
* Migration files that weren't generated by us
* The Gemfile, since it includes an important comment that must be on
  the same line as the gem declaration
* The Budget::Stats class, since the heading statistics are a mess and
  having shorter lines would require a lot of refactoring
This commit is contained in:
Javi Martín
2023-07-19 21:37:59 +02:00
parent 75d2782061
commit a1439d0790
156 changed files with 1330 additions and 503 deletions

View File

@@ -2,23 +2,28 @@ section "Creating Geozones" do
Geozone.create!(name: I18n.t("seeds.geozones.north_district"),
external_code: "001", census_code: "01",
html_map_coordinates: "30,139,45,153,77,148,107,165,138,201,146,218,186,198,216," \
"196,233,203,240,215,283,194,329,185,377,184,388,165,369,126,333,113,334,84,320," \
"66,286,73,258,65,265,57,249,47,207,58,159,84,108,85,72,101,51,114")
"196,233,203,240,215,283,194,329,185,377,184,388,165,369," \
"126,333,113,334,84,320,66,286,73,258,65,265,57,249,47," \
"207,58,159,84,108,85,72,101,51,114")
Geozone.create!(name: I18n.t("seeds.geozones.west_district"),
external_code: "002", census_code: "02",
html_map_coordinates: "42,153,31,176,24,202,20,221,44,235,59,249,55,320,30,354," \
"31,372,52,396,64,432,89,453,116,432,149,419,162,412,165,377,172,357,189,352,228," \
"327,246,313,262,297,234,291,210,284,193,284,176,294,158,303,154,310,146,289,140," \
"268,138,246,135,236,139,222,151,214,136,197,120,179,99,159,85,149,65,149,56,149")
"31,372,52,396,64,432,89,453,116,432,149,419,162,412,165," \
"377,172,357,189,352,228,327,246,313,262,297,234,291,210," \
"284,193,284,176,294,158,303,154,310,146,289,140,268,138," \
"246,135,236,139,222,151,214,136,197,120,179,99,159,85," \
"149,65,149,56,149")
Geozone.create!(name: I18n.t("seeds.geozones.east_district"),
external_code: "003", census_code: "03",
html_map_coordinates: "175,353,162,378,161,407,153,416,167,432,184,447,225,426," \
"250,409,283,390,298,369,344,363,351,334,356,296,361,267,376,245,378,185,327,188," \
"281,195,239,216,245,221,245,232,261,244,281,238,300,242,304,251,285,262,278,277," \
"267,294,249,312,219,333,198,346,184,353")
"250,409,283,390,298,369,344,363,351,334,356,296,361,267," \
"376,245,378,185,327,188,281,195,239,216,245,221,245,232," \
"261,244,281,238,300,242,304,251,285,262,278,277,267,294," \
"249,312,219,333,198,346,184,353")
Geozone.create!(name: I18n.t("seeds.geozones.central_district"),
external_code: "004", census_code: "04",
html_map_coordinates: "152,308,137,258,133,235,147,216,152,214,186,194,210,196," \
"228,202,240,216,241,232,263,243,293,241,301,245,302,254,286,265,274,278,267,296," \
"243,293,226,289,209,285,195,283,177,297")
"228,202,240,216,241,232,263,243,293,241,301,245,302,254," \
"286,265,274,278,267,296,243,293,226,289,209,285,195,283," \
"177,297")
end

View File

@@ -10,6 +10,7 @@ class CreateInappropiateFlags < ActiveRecord::Migration[4.2]
end
add_index :inappropiate_flags, [:flaggable_type, :flaggable_id]
add_index :inappropiate_flags, [:user_id, :flaggable_type, :flaggable_id], name: "access_inappropiate_flags"
add_index :inappropiate_flags, [:user_id, :flaggable_type, :flaggable_id],
name: "access_inappropiate_flags"
end
end

View File

@@ -1,12 +1,19 @@
class CreateRelatedContent < ActiveRecord::Migration[4.2]
def change
create_table :related_contents do |t|
t.references :parent_relationable, polymorphic: true, index: { name: "index_related_contents_on_parent_relationable" }
t.references :child_relationable, polymorphic: true, index: { name: "index_related_contents_on_child_relationable" }
t.references :parent_relationable, polymorphic: true,
index: { name: "index_related_contents_on_parent_relationable" }
t.references :child_relationable, polymorphic: true,
index: { name: "index_related_contents_on_child_relationable" }
t.references :related_content, index: { name: "opposite_related_content" }
t.timestamps
end
add_index :related_contents, [:parent_relationable_id, :parent_relationable_type, :child_relationable_id, :child_relationable_type], name: "unique_parent_child_related_content", unique: true, using: :btree
add_index :related_contents,
[:parent_relationable_id, :parent_relationable_type,
:child_relationable_id, :child_relationable_type],
name: "unique_parent_child_related_content",
unique: true,
using: :btree
end
end

View File

@@ -6,6 +6,10 @@ class CreateRelatedContentScores < ActiveRecord::Migration[4.2]
t.integer :value
end
add_index :related_content_scores, [:user_id, :related_content_id], name: "unique_user_related_content_scoring", unique: true, using: :btree
add_index :related_content_scores,
[:user_id, :related_content_id],
name: "unique_user_related_content_scoring",
unique: true,
using: :btree
end
end

View File

@@ -1,6 +1,8 @@
class RenameAdministratorTaskToDashboardAdministratorTask < ActiveRecord::Migration[4.2]
def change
rename_index :administrator_tasks, "index_administrator_tasks_on_source_type_and_source_id", "index_dashboard_administrator_tasks_on_source"
rename_index :administrator_tasks,
"index_administrator_tasks_on_source_type_and_source_id",
"index_dashboard_administrator_tasks_on_source"
rename_table :administrator_tasks, :dashboard_administrator_tasks
end
end

View File

@@ -29,6 +29,9 @@ class CreateLegislationPeopleProposalsTable < ActiveRecord::Migration[4.2]
t.boolean "validated"
t.integer "cached_votes_score", default: 0
end
add_index "legislation_people_proposals", ["cached_votes_score"], name: "index_legislation_people_proposals_on_cached_votes_score", using: :btree
add_index "legislation_people_proposals",
["cached_votes_score"],
name: "index_legislation_people_proposals_on_cached_votes_score",
using: :btree
end
end

View File

@@ -4,7 +4,9 @@ class CreateSDGRelations < ActiveRecord::Migration[5.2]
t.references :related_sdg, polymorphic: true
t.references :relatable, polymorphic: true
t.index [:related_sdg_id, :related_sdg_type, :relatable_id, :relatable_type], name: "sdg_relations_unique", unique: true
t.index [:related_sdg_id, :related_sdg_type, :relatable_id, :relatable_type],
name: "sdg_relations_unique",
unique: true
t.timestamps
end

View File

@@ -20,7 +20,9 @@ class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
t.datetime :created_at, null: false
t.index [:record_type, :record_id, :name, :blob_id], name: "index_active_storage_attachments_uniqueness", unique: true
t.index [:record_type, :record_id, :name, :blob_id],
name: "index_active_storage_attachments_uniqueness",
unique: true
t.foreign_key :active_storage_blobs, column: :blob_id
end
end