]> git.openstreetmap.org Git - rails.git/commitdiff
Use the db:seed task to load languages
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 30 Sep 2020 13:09:49 +0000 (15:09 +0200)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 30 Sep 2020 13:09:49 +0000 (15:09 +0200)
This is seed data that should reasonably be loaded into every database,
even those that are otherwise empty (e.g. no geo data). Using the seeds
process means that it will usually be loaded by default, and is easier
to find for existing rails developers.

.rubocop.yml
db/seeds.rb
script/locale/reload-languages [deleted file]

index ac29f4fc8769d9aec2d1142f33eef65bf698383e..200ab8a00816b92077b78ea72c7908636d9a989e 100644 (file)
@@ -37,7 +37,6 @@ Metrics/ModuleLength:
 Naming/FileName:
   Exclude:
     - 'script/deliver-message'
-    - 'script/locale/reload-languages'
     - 'script/update-spam-blocks'
 
 Naming/MethodParameterName:
index 1beea2accd7ed91d080b323eef17dba95e95e27f..742704b51ccfecd78b92153154ea7804d1f99b20 100644 (file)
@@ -5,3 +5,5 @@
 #
 #   movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
 #   Character.create(name: 'Luke', movie: movies.first)
+
+Language.load(Rails.root.join("config/languages.yml"))
diff --git a/script/locale/reload-languages b/script/locale/reload-languages
deleted file mode 100755 (executable)
index 56a96b6..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env ruby
-
-require File.dirname(__FILE__) + "/../../config/environment"
-
-Language.load(RAILS_ROOT + "/config/languages.yml")