lib/earth/pet/breed_gender.rb in earth-0.12.4 vs lib/earth/pet/breed_gender.rb in earth-1.0.0
- old
+ new
@@ -1,14 +1,29 @@
+require 'earth/model'
+
+require 'earth/pet/breed'
+require 'earth/pet/gender'
+
class BreedGender < ActiveRecord::Base
+ extend Earth::Model
+
+ TABLE_STRUCTURE = <<-EOS
+
+CREATE TABLE breed_genders
+ (
+ name CHARACTER VARYING(255) NOT NULL PRIMARY KEY,
+ breed_name CHARACTER VARYING(255),
+ gender_name CHARACTER VARYING(255),
+ weight FLOAT,
+ weight_units CHARACTER VARYING(255)
+ );
+
+EOS
+
self.primary_key = "name"
belongs_to :breed, :foreign_key => 'breed_name'
belongs_to :gender, :foreign_key => 'gender_name'
- col :name
- col :breed_name
- col :gender_name
- col :weight, :type => :float
- col :weight_units
warn_unless_size 586
end