Skip to content

Commit

Permalink
Fixing origin validation
Browse files Browse the repository at this point in the history
  • Loading branch information
jywarren authored Apr 21, 2020
1 parent 04fa19a commit ba35047
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/map.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ba35047

Please sign in to comment.