I don't think this make sense to be in Rails.

We don't want to burden the user by default with a lot of validations.

Rafael Mendonça França
http://twitter.com/rafaelfranca
https://github.com/rafaelfranca



On Tue, Dec 18, 2012 at 9:08 AM, akalyaev <[email protected]> wrote:

> The intro to this topic: https://github.com/kaize/valle. This problem is
> not new. There are some similar gems, e.g.
> http://github.com/rubiety/validates_lengths_from_database. All, in
> general, do the same thing - get information about the limitations (length
> or maximum/minimum value) and apply them to the model.
>
> At this moment, limit is only used for mapping between ActiveRecord and
> database. For example (suppose we have PostgreSQL DB):
>
> migration with
>     t.integer :age, limit: 2
> transforms into `age smallint` in PostgreSQL.
>
>
> But, default integer field do not have limit:
>
> migration with
>     t.integer :age
> transforms into `age integer` in PostgreSQL.
>
>
> PostgreSQL actually can store only 4 bytes.
>
> This means: "*limit inside AbstractAdapter::Column does not mean the
> actual limit in the database for that type*"
>
> I would like to ask does it make sense (to Rails):
> 1) to field to store actual limit for that type?
> 2) to implement an automatic check if value is out of acceptable range?
>
> Regards,
> Anton
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Core" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/rubyonrails-core/-/qxaWMMTLxmsJ.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-core?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to