FIX: Only validate uploaded URLs if they change
This commit is contained in:
parent
ed0b355e15
commit
1f5325e3f0
|
@ -38,8 +38,8 @@ class Category < ActiveRecord::Base
|
|||
|
||||
validate :email_in_validator
|
||||
|
||||
validates :logo_url, upload_url: true
|
||||
validates :background_url, upload_url: true
|
||||
validates :logo_url, upload_url: true, if: :logo_url_changed?
|
||||
validates :background_url, upload_url: true, if: :background_url_changed?
|
||||
|
||||
validate :ensure_slug
|
||||
before_save :apply_permissions
|
||||
|
|
|
@ -9,8 +9,8 @@ class UserProfile < ActiveRecord::Base
|
|||
before_save :cook
|
||||
after_save :trigger_badges
|
||||
|
||||
validates :profile_background, upload_url: true
|
||||
validates :card_background, upload_url: true
|
||||
validates :profile_background, upload_url: true, if: :profile_background_changed?
|
||||
validates :card_background, upload_url: true, if: :card_background_changed?
|
||||
|
||||
belongs_to :card_image_badge, class_name: 'Badge'
|
||||
has_many :user_profile_views, dependent: :destroy
|
||||
|
|
Loading…
Reference in New Issue