2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-07-25 18:06:53 +02:00
|
|
|
require "administrate/field/base"
|
|
|
|
|
|
|
|
class GeopointField < Administrate::Field::Base
|
|
|
|
def lat
|
|
|
|
data.first
|
|
|
|
end
|
|
|
|
|
|
|
|
def lng
|
|
|
|
data.last
|
|
|
|
end
|
2022-09-05 12:33:16 +02:00
|
|
|
|
|
|
|
def present?
|
|
|
|
lat.present? && lng.present?
|
|
|
|
end
|
2022-07-25 18:06:53 +02:00
|
|
|
end
|