[rspec-users] variable strange change
dchelimsky at gmail.com
Wed Sep 15 09:22:42 EDT 2010
On Wed, Sep 15, 2010 at 3:19 AM, Zhenning Guan <lists at ruby-forum.com> wrote:
> class User
> has_many :mads
> def mad
> class God
> belongs_to :mad
> belongs_to :user
> belongs_to :sender, :class_name => "User", :foreign_key => "sender_id"
> def strange_change!
> God.transaction do
> puts mad.nil? #the first time put is false
> if mad.nil?
> puts 'some thing exctue here' #no puts anything
> mad = you.mad
> puts mad.nil? #the second time put is true
> why the mad will become nil?
Seems like a Rails question, not an RSpec question. Please post Rails
questions to http://groups.google.com/group/rubyonrails-talk.
More information about the rspec-users