diff --git a/app/models/map.rb b/app/models/map.rb index a5ab25f99..1a924d498 100755 --- a/app/models/map.rb +++ b/app/models/map.rb @@ -13,8 +13,8 @@ class Map < ApplicationRecord # :message => " must not include spaces and must be alphanumeric, as it'll be used in the URL of your map, like: https://mapknitter.org/maps/your-map-name. You may use dashes and underscores.", # :on => :create # validates_format_of :tile_url, :with => /^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/ix - validates_with NotAtOriginValidator, unless: Proc.new { |map| map.created_at < DateTime.new(2015, 1, 13, 0, 0, 0) } - validates :lat, :lon, NotAtOrigin: true, unless: Proc.new { |map| map.created_at < DateTime.new(2015, 1, 13, 0, 0, 0) } + validates_with NotAtOriginValidator + validates :lat, :lon, NotAtOrigin: true has_many :exports, dependent: :destroy has_many :tags, dependent: :destroy