From a1f6b47af8911d9aa6c90654299109a22cabdb02 Mon Sep 17 00:00:00 2001 From: Anna Bargiel Date: Tue, 3 Oct 2023 08:42:21 +0200 Subject: [PATCH] Fix name of field in seeds Among other things, we changed the names of fields in the database for the person model. We changed blog to blog_url and website to website_url. But we didn't change the names of the fields for assign_attributes in seeds. The problem occurs when we set up a new application environment. I'm getting information about aborted loading of seeds because of incompatibility name of fields during `rails db:seed`. --- db/seeds/team/torrocus.rb | 4 ++-- db/seeds/team/womanonrails.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/db/seeds/team/torrocus.rb b/db/seeds/team/torrocus.rb index d470eb8d..114a9292 100644 --- a/db/seeds/team/torrocus.rb +++ b/db/seeds/team/torrocus.rb @@ -1,6 +1,6 @@ torrocus = Person.where(nickname: 'torrocus').first_or_initialize torrocus.assign_attributes( - blog: 'https://torrocus.com/blog/', + blog_url: 'https://torrocus.com/blog/', description: 'Ruby on Rails developer', facebook: 'torrocus', first_name: 'Alex', @@ -15,7 +15,7 @@ Agile, Team Building, Linux Server Administration, Remote Work, Product Development ), twitter: 'torrocus', - website: 'https://torrocus.com' + website_url: 'https://torrocus.com' ) I18n.locale = :en diff --git a/db/seeds/team/womanonrails.rb b/db/seeds/team/womanonrails.rb index 5e73e1f5..23684f29 100644 --- a/db/seeds/team/womanonrails.rb +++ b/db/seeds/team/womanonrails.rb @@ -1,6 +1,6 @@ womanonrails = Person.where(nickname: 'womanonrails').first_or_initialize womanonrails.assign_attributes( - blog: 'https://womanonrails.com', + blog_url: 'https://womanonrails.com', description: 'Ruby on Rails developer', facebook: 'womanonrails', first_name: 'Agnieszka',