Changes suggested in PR:

* Delete all things related to banner images and styles (in code)
* Add a new test to check that the banner is showing correctly
* Update the specs accordingly to match the changes

Update dev_seed to set a random background_color and a font_color for banners (and remove everything about image and style)
Add a rake task to migrate the banner style to backgroun_color and font_color (so that the banners have the same colors than before)
This commit is contained in:
iagirre
2018-01-24 16:23:12 +01:00
committed by Angel Perez
parent 5d1b06a3cb
commit 82cb8d4c52
8 changed files with 75 additions and 58 deletions

20
lib/tasks/banners.rake Normal file
View File

@@ -0,0 +1,20 @@
namespace :banners do
desc "Migrate styles to background_color and font_color"
task migrate_style: :environment do
Banner.all.each do |banner|
banner.font_color = '#FFFFFF'
case banner.style
when "banner-style banner-style-one"
banner.background_color = '#004a83'
when "banner-style banner-style-two"
banner.background_color = '#7e328a'
when "banner-style banner-style-three"
banner.background_color = '#33dadf'
end
banner.save
end
end
end