Let''s say you have a model Foo, and you want the length of a column
"bar" - then this will do what you want:
Foo.columns.find { |c| c.name == ''bar'' }.limit
--Matt Jones
On Jun 14, 12:01 am, Phlip
<phlip2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Railsters:
>
> My evil colleagues could migrate the :limit=> on an important string at
any
> time. (Think Twitter''s infamous string :limit => 140.)
>
> I don''t want to guess that limit and hard-code it into the
program; I want to
> read it back out of the ActiveRecord field properties. How to navigate to
them?
>
> --
> Phlip