Class BelongsTo
In: app/models/belongs_to.rb
Parent: ActiveRecord::Base

-*- coding: utf-8 -*-

Schema Information

Schema version: 87

Table name: belongs_tos

 id                   :integer       not null, primary key
 domain_id            :integer       not null
 application_table_id :integer       not null
 name                 :string(255)   not null
 class_name           :string(255)
 forein_key           :string(255)
 polymorphic          :boolean
 created_at           :string(14)
 updated_at           :string(14)
 created_by           :integer
 updated_by           :integer
 created_in           :integer
 updated_in           :integer
 lock_version         :integer       default(0), not null

Methods

code  

Public Instance methods

コードに埋め込まれる文字列を返す。

[Source]

    # File app/models/belongs_to.rb, line 28
28:   def code
29:     l = "belongs_to :#{name}"
30:     l << ", :class_name => \"#{class_name}\"" unless class_name.blank?
31:     l << ", :forein_key => \"#{forein_key}\"" unless forein_key.blank?
32:     l << ", :polymorphic => true" if polymorphic?
33:     return l
34:   end

[Validate]