add image in podcast seeds in suggested way (#10371)
as described in [the carrierwave wiki](7041728c73)
otherwise seeding fails on Podcast validations:
```
ActiveRecord::RecordInvalid: Validation failed: Image Image has an unsupported type, Image can't be blank
/opt/apps/bundle/gems/activerecord-6.0.3.3/lib/active_record/validations.rb:80:in `raise_validation_error'
/opt/apps/bundle/gems/activerecord-6.0.3.3/lib/active_record/validations.rb:53:in `save!'
...
/opt/apps/forem/db/seeds.rb:267:in `block (2 levels) in <main>'
/opt/apps/forem/db/seeds.rb:266:in `each'
/opt/apps/forem/db/seeds.rb:266:in `block in <main>'
/opt/apps/forem/db/seeds.rb:19:in `create_if_none'
/opt/apps/forem/db/seeds.rb:206:in `<main>'
```
This commit is contained in:
parent
6d1984163e
commit
b24c96010d
1 changed files with 4 additions and 4 deletions
|
|
@ -218,7 +218,7 @@ seeder.create_if_none(Podcast) do
|
|||
main_color_hex: "2faa4a",
|
||||
overcast_url: "https://overcast.fm/itunes919219256/codenewbie",
|
||||
android_url: "https://subscribeonandroid.com/feeds.podtrac.com/q8s8ba9YtM6r",
|
||||
image: Rack::Test::UploadedFile.new(image_file, "image/jpeg"),
|
||||
image: Pathname.new(image_file).open,
|
||||
published: true
|
||||
},
|
||||
{
|
||||
|
|
@ -231,7 +231,7 @@ seeder.create_if_none(Podcast) do
|
|||
main_color_hex: "111111",
|
||||
overcast_url: "https://overcast.fm/itunes769189585/coding-blocks",
|
||||
android_url: "http://subscribeonandroid.com/feeds.podtrac.com/c8yBGHRafqhz",
|
||||
image: Rack::Test::UploadedFile.new(image_file, "image/jpeg"),
|
||||
image: Pathname.new(image_file).open,
|
||||
published: true
|
||||
},
|
||||
{
|
||||
|
|
@ -244,7 +244,7 @@ seeder.create_if_none(Podcast) do
|
|||
main_color_hex: "181a1c",
|
||||
overcast_url: "https://overcast.fm/itunes979020229/talk-python-to-me",
|
||||
android_url: "https://subscribeonandroid.com/talkpython.fm/episodes/rss",
|
||||
image: Rack::Test::UploadedFile.new(image_file, "image/jpeg"),
|
||||
image: Pathname.new(image_file).open,
|
||||
published: true
|
||||
},
|
||||
{
|
||||
|
|
@ -258,7 +258,7 @@ seeder.create_if_none(Podcast) do
|
|||
main_color_hex: "343d46",
|
||||
overcast_url: "https://overcast.fm/itunes1006105326/developer-on-fire",
|
||||
android_url: "http://subscribeonandroid.com/developeronfire.com/rss.xml",
|
||||
image: Rack::Test::UploadedFile.new(image_file, "image/jpeg"),
|
||||
image: Pathname.new(image_file).open,
|
||||
published: true
|
||||
},
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue