Add Goals seeds and translations

Extracted from the official United Nations Sustainable Development
Goals website [1].

[1] https://www.un.org/sustainabledevelopment/sustainable-development-goals/
This commit is contained in:
Senén Rodero Rodríguez
2020-11-12 14:26:03 +01:00
committed by Javi Martín
parent cb78a254f4
commit cbe84450ac
9 changed files with 124 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
class SDG::Goal < ApplicationRecord
validates :code, presence: true, uniqueness: true
validates :code, presence: true, uniqueness: true, inclusion: { in: 1..17 }
def title
I18n.t("sdg.goals.goal_#{code}.title")