mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
12 lines
285 B
Ruby
12 lines
285 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Area < ApplicationRecord
|
|
reverse_geocoded_by :latitude, :longitude
|
|
|
|
belongs_to :user
|
|
has_many :visits, dependent: :destroy
|
|
|
|
validates :name, :latitude, :longitude, :radius, presence: true
|
|
|
|
def center = [latitude.to_f, longitude.to_f]
|
|
end
|