Skip to content

Commit

Permalink
Fix name of field in seeds
Browse files Browse the repository at this point in the history
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.
Locally I have loaded seeds, so no problem showed.
When we deploy the application to fly.io,
we need to load seeds every time.

I'm getting information about aborted loading of seeds
because of incompatibility name of fields during `rails db:seed`.
  • Loading branch information
ania-hm committed Oct 3, 2023
1 parent e50b351 commit b5bc824
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions db/seeds/team/torrocus.rb
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion db/seeds/team/womanonrails.rb
Original file line number Diff line number Diff line change
@@ -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',
Expand Down

0 comments on commit b5bc824

Please sign in to comment.