On Sun, Aug 8, 2010 at 4:18 PM, RichardOnRails <[email protected]> wrote:
> I've got an Expense model as follows: > > class Expense < ActiveRecord::Base > belongs_to :vendor > > def validate_on_create > unless params["expense"]["vendor_id"] != "0" # <= Line 5 ?? At that point your instance of Expense should already have its vendor_id value -- kinda the point -- so unless self.vendor_id != 0 # or whatever -- what if it's nil? :-) HTH, -- Hassan Schroeder ------------------------ [email protected] twitter: @hassan -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" 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-talk?hl=en.

