Allow change map image from admin site customization

Also adds on site customization image.rb jpeg content type to allow replace this image.
This commit is contained in:
decabeza
2019-01-24 11:48:25 +01:00
parent 7e89cc149f
commit 045c4eca64
5 changed files with 46 additions and 10 deletions

View File

@@ -4,13 +4,14 @@ class SiteCustomization::Image < ActiveRecord::Base
"social_media_icon" => [470, 246],
"social_media_icon_twitter" => [246, 246],
"apple-touch-icon-200" => [200, 200],
"budget_execution_no_image" => [800, 600]
"budget_execution_no_image" => [800, 600],
"map" => [420, 500]
}
has_attached_file :image
validates :name, presence: true, uniqueness: true, inclusion: { in: VALID_IMAGES.keys }
validates_attachment_content_type :image, content_type: ["image/png"]
validates_attachment_content_type :image, content_type: ["image/png", "image/jpeg"]
validate :check_image
def self.all_images