> >> > I tried this > > >> > def before_create > >> > debugger > >> > stg = Storage.create!(:product_id => > >> > self.product_id, :current_quantity > >> > => self.quantity, :stg_data => purchase.prc_data) > >> > end > > >> > and when I "inspect" the variable "stg" I got "stg => nil" as result > > >> That is not surprising since you have broken *before* the line that > >> allocates stg. > > >> Colin > > > If I break after that line... "stg" does not appear > > what do you mean it does not appear? > > Remember that you can inspect data and evaluate expressions in the debugger. > > Colin
When I used debugger the first time (in the line before the callback) I chose option "var local" and I got stg => nil But when I use debugger after that line I get this blk => #<Proc:0xc302b34@/usr/local/ruby/lib/ruby/gems/1.9.1/gems/ activerecord-3.0.9/lib/active_record/callbacks.rb:277> halted => false key => nil name => nil result => true value => 88 And if I try to "inspect" stg I get var instance stg NameError Exception: undefined local variable or method `stg' for #<DetailPurchase:0xb4d3054> -- 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.

