static public Method

Base.columns

Returns an array of column objects for the table associated with this class.

Source Code

# File active_record/base.rb, line 1078
def columns
  unless @columns
    @columns = connection.columns(table_name, "#{name} Columns")
    @columns.each {|column| column.primary = column.name == primary_key}
  end
  @columns
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.