Files
openfoodnetwork/app/models/spree/country.rb
2025-03-25 18:46:00 +01:00

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