Sha256: 819aba121a944de6f4808383a3b44b9d1179455cffc489384935489745af4139

Contents?: true

Size: 330 Bytes

Versions: 2

Compression:

Stored size: 330 Bytes

Contents

module Admin
  class State < ActiveRecord::Base
    include AssociationCommon
    self.table_name = "states"

    belongs_to :country
    has_many :cities

    scope :national, -> {includes(:country).where("countries.code = ?", "BR")}
    scope :international, -> {includes(:country).where("countries.code <> ?", "BR")}
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
carnival-0.0.11 test/dummy/app/models/admin/state.rb
carnival-0.0.10 test/dummy/app/models/admin/state.rb