ActiveRecord 'Column' class doc?

Can’t seem to find the Column class API documentation. For example,
content_columns
returns a list of Column objects, but where is the doc for this Column
class?

Thanks in advance,
Don McClean

Don Mc wrote:

Can’t seem to find the Column class API documentation. For example,
content_columns
returns a list of Column objects, but where is the doc for this Column
class?

Thanks in advance,
Don McClean

I think its this:
http://api.rubyonrails.com/classes/ActiveRecord/ConnectionAdapters/Column.html

In irb prompt try:

SomeModel.content_columns.first.class

and see what you get.

Thanks, thats it!

Don

On Mar 23, 12:52 am, Alex W. [email protected]

Bill,
Thanks, that is a good idea.

Don

Hi Don,
Don.Mc wrote:

Can’t seem to find the Column class API documentation.
For example, content_columns returns a list of Column
objects, but where is the doc for this Column class?

Don’t know if this will help, but I had a similar situation recently and
someone suggested I use script\console to find out what I wanted to
know.
In my case I wanted to know what methods were valid on a field in my
Actors
table. So after starting script\console…

require ‘Actor’
Actor.columns.methods

returns the methods on all the fields.

Actor.columns_hash[‘field_name’].methods

returns the methods on the specified field

Actor.columns_hash[‘field_name’].limit # using one method as an example

returns the size of the specified field.

etc.

HTH,
Bill

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs