Skip to content

Instantly share code, notes, and snippets.

@foxweb
Created November 29, 2010 12:32
Show Gist options
  • Save foxweb/719900 to your computer and use it in GitHub Desktop.
Save foxweb/719900 to your computer and use it in GitHub Desktop.
class Request < ActiveRecord::Base
validates_length_of :lastname, :minimum => 2
validates_length_of :lastname_prev, :minimum => 2, :allow_blank => true
validates_length_of :firstname, :minimum => 2
belongs_to :birth_country_rel, :class_name => 'Country', :foreign_key => :birth_country
belongs_to :national_rel, :class_name => 'Country', :foreign_key => :national
belongs_to :birth_national_rel, :class_name => 'Country', :foreign_key => :birth_national
belongs_to :country_start_rel, :class_name => 'Country', :foreign_key => :country_start
belongs_to :country_dest_rel, :class_name => 'Country', :foreign_key => :country_dest
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment