Class | HasMany
In: | app/models/has_many.rb
Parent: | ActiveRecord::Base

-*- coding: utf-8 -*-

## Schema Information

Schema version: 87

Table name: has_manies

     id                   :integer       not null, primary key
     domain_id            :integer       not null
     application_model_id :integer       not null
     name                 :string(255)   not null
     class_name           :string(255)
     foreign_key          :string(255)
     as_name              :string(255)
     dependent            :string(255)
     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

code()

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

[Source]

        # File app/models/has_many.rb, line 29
    29:   def code
    30:     c = "has_many :#{name}"
    31:     c << ", :class_name => \"#{class_name}\"" unless class_name.blank?
    32:     c << ", :foreign_key => \"#{foreign_key}\"" unless foreign_key.blank?
    33:     c << ", :as => :#{as_name}" unless as_name.blank?
    34:     c << ", :dependent => :#{dependent}" unless dependent.blank?
    35:     return c
    36:   end

[Validate]