mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-28 21:07:16 +00:00
18 lines
315 B
Ruby
18 lines
315 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Spree
|
|
class Country < ApplicationRecord
|
|
has_many :states, -> { order('name ASC') }, inverse_of: :country, dependent: :destroy
|
|
|
|
validates :name, :iso_name, presence: true
|
|
|
|
def <=>(other)
|
|
name <=> other.name
|
|
end
|
|
|
|
def to_s
|
|
name
|
|
end
|
|
end
|
|
end
|