# Where's the list of valid attributes / methods for column ob

**URL:** <https://www.ruby-forum.com/t/wheres-the-list-of-valid-attributes-methods-for-column-ob/87390>\
**Category:** Rails\
**Created:** [March 2, 2007, 6:14am UTC](https://www.ruby-forum.com/t/wheres-the-list-of-valid-attributes-methods-for-column-ob/87390 "2007-03-02T06:14:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [March 2, 2007, 6:14am UTC](https://www.ruby-forum.com/t/wheres-the-list-of-valid-attributes-methods-for-column-ob/87390/1 "2007-03-02T06:14:33Z")

</div>

I’m trying to figure out what the valid attributes are on a column  
object.  
The Rails scaffolding generates a list view that uses column.column\_name  
for  
example. ActiveRecord::Base#columns says it returns “an array of column  
objects for the table associated with this class”. But I can’t find a  
list  
of the attributes of / methods on a column object anywhere.

Any help would be very much appreciated.

Thanks,  
Bill

---

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [March 2, 2007, 10:17am UTC](https://www.ruby-forum.com/t/wheres-the-list-of-valid-attributes-methods-for-column-ob/87390/2 "2007-03-02T10:17:53Z")

</div>

Hello,

On 2 Mar 2007, at 05:07, Bill W. wrote:

> I’m trying to figure out what the valid attributes are on a column  
> object.  
> The Rails scaffolding generates a list view that uses  
> column.column\_name for  
> example. ActiveRecord::Base#columns says it returns “an array of  
> column  
> objects for the table associated with this class”. But I can’t  
> find a list  
> of the attributes of / methods on a column object anywhere.

Try using script/console:

Let’s say that you have a User model.

> > User.columns.first.methods  
> > =\> [“to\_a”, “respond\_to?”, “returning”, “daemonize”, “type”, “limit”,  
> > “protected\_methods”, “human\_name”, “silence\_stream”, “eql?”,  
> > “number?”, “instance\_variable\_set”, “precision”, “is\_a?”, “taguri”,  
> > “hash”, “to\_s”, “send”, “dclone”, “remove\_subclasses\_of”, “ri”,  
> > “pretty\_print\_cycle”, “primary”, “default”, “with\_options”,  
> > “taguri=”, “silence\_warnings”, “pretty\_print\_inspect”, “class”,  
> > “tainted?”, “private\_methods”, “primary=”, “ **send** ”, “to\_yaml”,  
> > “to\_yaml\_properties”, “untaint”, “scale”,  
> > “extend\_with\_included\_modules\_from”, “id”, “instance\_eval”,  
> > “inspect”, “require\_library\_or\_gem”, “pretty\_print”, “klass”,  
> > “type\_cast\_code”, “clone”, “text?”, “public\_methods”, “b64encode”,  
> > “extended\_by”, “extend”, “require\_gem”, “freeze”, “suppress”,  
> > “display”, “encode64”, “instance\_values”, “po”, “type\_cast”, “`”,  
> > “ **id** ”, “pretty\_print\_instance\_variables”, “methods”, “==”,  
> > “method”, “sql\_type”, “decode64”, “gem”, “===”, “to\_json”,  
> > “subclasses\_of”, “dup”, “nil?”, “enable\_warnings”,  
> > “instance\_variables”, “copy\_instance\_variables\_from”, “instance\_of?”,  
> > “load”, “name”, “poc”, “to\_param”, “instance\_exec”, “=~”,  
> > “object\_id”, “singleton\_methods”, “decode\_b”, “null”, “unloadable”,  
> > “taint”, “equal?”, “silence\_stderr”, “blank?”,  
> > “instance\_variable\_get”, “frozen?”, “kind\_of?”, “require”,  
> > “to\_yaml\_style”]

Regards,  
Andy S.

---

<div class="post-metadata">

**Author:** ![wpwood](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/d6d6ee/32.png) [@wpwood](https://www.ruby-forum.com/u/wpwood)\
**Post date:** [March 2, 2007, 10:26pm UTC](https://www.ruby-forum.com/t/wheres-the-list-of-valid-attributes-methods-for-column-ob/87390/3 "2007-03-02T22:26:37Z")

</div>

Also see:

[http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/Column.html](http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/Column.html)

~ j.
