On 24 April 2014 20:50, <
john...@gmail.com> wrote:
> I'm a beginner in Rails working through the Hartl tutorial while trying to
> work on my own project(s) at the same time.
>
> One Project I'm trying to work on is a basic 'assembly' application because
> it's what I do now full time.
>
> Right now it's a pretty basic app with 3 Models
>
> Ingredient
> Bulk
> RecipeItem
>
> There is a has_many through relationship between Ingredient and Bulk through
> RecipeItem
>
> In the recipe_items table there is an additional attribute i'm calling
> quantity - it must be greater than 0 and less than 1.
What is the data type of quantity in the database?
Colin
>
> The validation question I have is this.
>
> Is there an easy way to set up a validation on a Bulk object that requires
> its related RecipeItem objects to add up to one...after all the recipeitem
> objects are added?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to
rubyonra...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/rubyonrails-talk/f16095c4-da9e-44bd-a094-f9539a99885c%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.