NoMethodError in FeedsController#do_validate
You have a nil object when you didn’t expect it!
The error occurred while evaluating nil.exited
RAILS_ROOT: /Users/jaysanders/Sites/rss/trunk
Application Trace | Framework Trace | Full Trace
vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb:
64:in perform' vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb: 94:in
fire’
vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb:
93:in each' vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb: 93:in
fire’
vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb:
201:in validated!' app/controllers/feeds_controller.rb:103:in
do_validate’
===
def do_validate
@feed = Feed.find(params[:id])
@feed.cache_feed
if @feed.feed_cache
@feed.validated!
else
@feed.invalidated!
end
respond_to do |format|
format.js { render :text => @feed.state }
end
end
===
acts_as_state_machine :initial => :submitted
state :valid_address
state :invalid_address
state :readable_feed
state :unreadable_feed
state :active
state :invalid
event :validated do
transitions :from => :submitted, :to => :valid_address
end
===
Any ideas? If I comment out line 64 from acts_as_state_machine.rb,
everything works beautifully. What am I missing? Thanks!