Sha256: 44e278fe35312fe22915b62857cabeee3583ac6c8d980a993d676f23e7cb3a82

Contents?: true

Size: 606 Bytes

Versions: 7

Compression:

Stored size: 606 Bytes

Contents

require 'earth/model'

require 'earth/pet/breed_gender'
require 'earth/pet/species'

class Breed < ActiveRecord::Base
  extend Earth::Model

  TABLE_STRUCTURE = <<-EOS

CREATE TABLE breeds
  (
     name         CHARACTER VARYING(255) NOT NULL PRIMARY KEY,
     species_name CHARACTER VARYING(255),
     weight       FLOAT,
     weight_units CHARACTER VARYING(255)
  );

EOS

  self.primary_key = "name"
  
  has_many :breed_genders, :foreign_key => 'breed_name'
  belongs_to :species, :foreign_key => 'species_name'
  
  warn_if_nulls_except(
    :weight,
    :weight_units
  )

  warn_unless_size 522
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
earth-1.2.1 lib/earth/pet/breed.rb
earth-1.1.2 lib/earth/pet/breed.rb
earth-1.1.1 lib/earth/pet/breed.rb
earth-1.1.0 lib/earth/pet/breed.rb
earth-1.0.3 lib/earth/pet/breed.rb
earth-1.0.2 lib/earth/pet/breed.rb
earth-1.0.1 lib/earth/pet/breed.rb