Sha256: 531f7f0234a72146931c8a20747d074d9a3409f158e705969192e0903f4ad1d6
Contents?: true
Size: 433 Bytes
Versions: 18
Compression:
Stored size: 433 Bytes
Contents
module Admin class State < ActiveRecord::Base include Carnival::ModelHelper self.table_name = "states" belongs_to :country has_many :cities validates_presence_of :name validates_presence_of :code validates_uniqueness_of :code scope :national, -> {includes(:country).where("countries.code = ?", "BR")} scope :international, -> {includes(:country).where("countries.code <> ?", "BR")} end end
Version data entries
18 entries across 18 versions & 1 rubygems