Sha256: 4d4aacbf679d343b9a63e67caf7316120727edc84b3586fcb417dea24e8c374e

Contents?: true

Size: 557 Bytes

Versions: 17

Compression:

Stored size: 557 Bytes

Contents

class Country < FrozenRecord::Base
  self.default_attributes = { contemporary: true, available: true }

  add_index :name, unique: true
  add_index :continent

  def self.republics
    where(king: nil)
  end

  def self.nato
    where(nato: true)
  end

  def self.continent_and_capital(continent, capital:)
    where(continent: continent, capital: capital)
  end

  def reverse_name
    name.reverse
  end
end

module Compact
  class Country < ::Country
    include FrozenRecord::Compact
    def self.file_path
      superclass.file_path
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
frozen_record-0.26.2 spec/support/country.rb
frozen_record-0.26.1 spec/support/country.rb
frozen_record-0.26.0 spec/support/country.rb
frozen_record-0.25.5 spec/support/country.rb
frozen_record-0.25.4 spec/support/country.rb
frozen_record-0.25.3 spec/support/country.rb
frozen_record-0.25.2 spec/support/country.rb
frozen_record-0.25.1 spec/support/country.rb
frozen_record-0.25.0 spec/support/country.rb
frozen_record-0.24.1 spec/support/country.rb
frozen_record-0.23.0 spec/support/country.rb
frozen_record-0.22.2 spec/support/country.rb
frozen_record-0.22.1 spec/support/country.rb
frozen_record-0.22.0 spec/support/country.rb
frozen_record-0.21.1 spec/support/country.rb
frozen_record-0.21.0 spec/support/country.rb
frozen_record-0.20.1 spec/support/country.rb