similar to: ActiveRecord::RecordNotFound

Displaying 20 results from an estimated 20000 matches similar to: "ActiveRecord::RecordNotFound"

2005 Jun 30
2
Find by ID plus conditions -> ActiveRecord::RecordNotFound
Hi I''m trying to understand the AR find facilities, described here: http://api.rubyonrails.com/classes/ActiveRecord/Base.html#M000650 I have a list of ids that I want to retrieve, but have a condition that should restrict the list returned: return self.find( noteids, :conditions => [ "(private = 0 OR (private = 1 AND user_id = ?))", userid] ) According to the
2007 May 08
2
ActiveRecord::RecordNotFound error
I was having problems with ActiveRecord::RecordNotFound in my code, so did a search on the forum here, and I got an application error. search string: ActiveRecord::RecordNotFound I am just reporting this so somebody could fix the problem? Andrew -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are
2006 Jul 03
2
Agile Web Dev on Rails - ActiveRecord::RecordNotFound Prob
Hi there I''ve also made a start on the Agile Web Dev using Rails book! I''ve been hit with a problem when hitting the ''Add to Cart'' button - I get the following error message: ActiveRecord::RecordNotFound in StoreController#add_to_cart Couldn''t find Product without an ID RAILS_ROOT: ./script/../config/.. Application Trace | Framework Trace | Full
2009 Apr 12
1
handling ActiveRecord::RecordNotFound
How should we handle requests for invalid objects which do not exist in database, ActiveRecord::RecordNotFound error ? I am writing begin-rescue as follows: def show begin @phone = Phone.find(params[:id]) rescue ActiveRecord::RecordNotFound flash[:notice] = NONEXIST_OBJECT redirect_to :controller => :phone, :action => :index else respond_to do |format|
2009 Feb 06
6
RecordNotFound bubbling thru to cucumber
Hello, I have a controller action that raises a RecordNotFound exception if you''re not allowed to see something. In my global application controller (application.rb), I catch these and render the 404 template. But when I run cucumber (using webrat), it''s getting the full stacktrace (the step blows up). Any ideas why? I have consider_all_requests_local turned off in my test.rb.
2006 Mar 15
4
ActiveRecord::RecordNotFound in search results act_as Ferret
Hello, I''ve installed the Ferret gem and also got the act_as_ferret code from the wiki. I''ve set up my model "Branch" to act as ferret using the code below. acts_as_ferret :options => {:fields => [''name'', ''body_text'', ''address'']} I''ve also set up a ferret_controller with the code below def find
2005 Feb 02
5
Planet Ruby on Rails
I just setup a Planet aggregator site for Ruby on Rails blogs and the wiki. It''s at: http://www.planetrubyonrails.org/ jim
2006 Feb 15
0
Multiple Conditions and ActiveRecord::RecordNotFound
Hey all, It seems that if I do a Foo.find(:first, :conditions => ["identifier = ?", content_identifier]) and no records are returned then I get the exception thrown. When I add a second condition Foo.find(:first, :conditions => ["identifier = ? AND bar = ?", content_identifier, "1"]) Even though again no records are returned, the exception isn''t
2009 Nov 10
1
ActiveRecord::RecordNotFound in LookController
I am finding this error.pls help me
2010 Aug 08
2
issue with rescue_action_in_public! and testing 404 responses
Hello, I''m new to rails and I''m trying to wrap my heads around how to spec controllers using RSpec (using rails 3rc1 and rspec 2.0.0.beta.19). The problem I''ve run into is when I want to test that my controllers respond with a 404 for unfound records. Whenever I run the spec, the ActiveRecord::RecordNotFound exception is not caught by rails, causing the spec
2008 Feb 13
5
Example controller spec no worky?
I''m trying to spec a dead simple "show non-existent record should render 404" case, but it seems the RecordNotFound exception is making it impossible for some reason. #controller def show @event = Event.find(params[:id]) end #spec - pretty much straight from the rspec site before do Event.stub!(:find) get :show, :id => ''broken'' end #
2006 May 06
6
assert_raises --> how does it work?
Hi, I have this code fragment: def test_delete_concept assert_not_nil Concept.find(concepts(:entreprise).id) get :delete_concept, {:concept_id => concepts(:entreprise).id} assert_raises :RecordNotFound, Concept.find(concepts(:entreprise).id) end basicaly, on the first line, I make sure that the concept exist in the DB. On the second line I delete the concept fron the DB.
2006 Jan 09
1
Problem with RecordNotFound without numeric id
Hi all, I have a problem handling errors for RecordNotFound (Page 86 of Agile Book), I want to redirect bad items id to "list" with a flash "Invalid Item", but this works only with numeric id, if I use some like "wibble" the result is an empty list of items. This is in my item_controller: def show @item = Item.find(params[:id]) rescue redirect_to :action
2006 Feb 16
3
rescue_action_in_public question
I''m using the rescue_action_in_public example from the Agile book to handle errors and email serious ones to me. In my application.rb controller: def rescue_action_in_public(exception) logger.error("rescue_action_in_public executed") case exception when ActiveRecord::RecordNotFound, ActionController::RoutingError, ActionController::UnknownAction
2007 Dec 22
8
Rails 2.0 rescue_from
I am trying to use the new Rails 2.0 macro : rescue_from class PostsController < ApplicationController rescue_from ActiveRecord::RecordNotFound, :with => :deny_access ... def show @post = Post.find_by_id(params[:id]) raise ActiveRecord::RecordNotFound if @post.nil? #illegal access ..... end def deny_access respond_to do |format| format.html end end but the
2009 Feb 10
2
rescue_from for NoMethodError
Hi everyone, I was just trying to catch some exceptions in my app, for "Record Not Found" I used this in my application.rb file rescue_from ActiveRecord::RecordNotFound, :with => :record_not_found rescue_from ActionController::NoMethodError, :with => :show_error private def record_not_found render :text => "404 Not Found", :status =>
2003 Oct 29
3
FW: Voice/Data mixed routing over Digium E1/T1 Card
> The documentation mentions that the Digium channels can be split into some > voice channels and the remainder of the channels used for routing IP > traffic. > > Does any one have this in use in conjunction with Asterisk? Does it work > well? Would you recommend it for a production server? > > Obviously, if this works, this makes for a cost effective platform where
2003 Nov 18
2
ISDN Card Types for Europe
What types of ISDN BRI cards work well in Europe (Guadeloupe, Martinique and France) ? For example: AVM C2 or AVM C4 or eicon Diva server 4 BRI? Any others? Which driver is appropriate? Ray Burkholder ray@oneunified.net http://www.oneunified.net 704 576 5101 -- Scanned for viruses and dangerous content at http://www.oneunified.net and is believed to be clean. -------------- next part
2006 Jun 02
7
Unit Tests crashing out for a table without an ID
I''m having problems unit testing my model- I have a kind of quiz functionality user table and a question table and a user_question_response table that contains the id for the user, the id for the question and the user''s response. The user_question_response has it''s own model belongs_to/has_many with users and questions and it works fine in the actual application but
2006 Feb 08
1
functional test problem
I am trying to write a test for my delete method. I find a User in the db by its id, do the delete action, then I want to see if it is still in the db. How do I check that the User IS Deleted without causing errors? ** My Test ******************************** def test_delete_user login user = User.find(2) post :delete_user, {:id => user.id} assert_equal "User