Hi,
I am not sure why, but I get the following error when I try to catch a
specific exception:
uninitialized constant One::ActiveRecord::RecordNotFound
Here is some example code that I will use for simplification.
Why can''t I specify the RecordNotFound in the rescue?
I am calling the check_object method from the ApplicationController on a
before filter.
So Confused!!!
---------- CODE ----------
module One
module Two
def check_object
id = 12345
begin
object = ObjectName.find(id)
rescue ActiveRecord::RecordNotFound => e
logger.debug("#{e} : #{id}")
end
# more code would go here.
end
end
end
ActionController::Base.send :include, One::Two
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---