Displaying 20 results from an estimated 23 matches for "find_from_ids".
2006 Jun 02
7
Unit Tests crashing out for a table without an ID
...h users and questions and it works
fine in the actual application but when I try to do any unit-testing of
my User model I get this:
ActiveRecord::RecordNotFound: Couldn''t find UserQuestionResponse without
an ID
.../gems/activerecord_1.14.2/lib/active_record/base.rb:932:in
''find_from_ids''
Any ideas what is going on and what I can do about it?
--
Posted via http://www.ruby-forum.com/.
2006 Aug 09
7
changing find method
Hi,
i was wondering if there was a nice clean way(after all, it is ruby) to
change the find method of a certain model/class (Page) so that if i
wanted to use a find method on a @page instance it would return only
specific rows from the table(if the page.published == true/false:
the pages table looked like
SQL:
...
id int not null auto_increment,
published tinyint(1) not null,
something
2006 Jul 03
2
Agile Web Dev on Rails - ActiveRecord::RecordNotFound Prob
...sage:
ActiveRecord::RecordNotFound in StoreController#add_to_cart
Couldn''t find Product without an ID
RAILS_ROOT: ./script/../config/..
Application Trace | Framework Trace | Full Trace
D:/Ruby/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:939:in
`find_from_ids''
D:/Ruby/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:382:in
`find''
#{RAILS_ROOT}/app/controllers/store_controller.rb:11:in `add_to_cart''
It seems to me that the id of the item is not been passed in - my
storecontroller code lo...
2009 Jul 20
2
Hitting unknown error with "can't dup NilClass"
...cal/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/
base.rb:1548:in `find_every''
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/
base.rb:1588:in `find_one''
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/
base.rb:1574:in `find_from_ids''
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/
base.rb:616:in `find''
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/
associations/belongs_to_association.rb:44:in `find_target''
/opt/local/lib/ruby/gems/1.8/gems/activerecord...
2006 Jul 06
0
problema con i test automatizzati
...or:
test_update(ProductTest):
ActiveRecord::RecordNotFound: Couldn''t find Product with ID=1
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:955:in
`find_one''
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:941:in
`find_from_ids''
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:382:in
`find'' test/unit/product_test.rb:7:in `setup_without_fixtures''
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/fixtures.rb:548:in
`setup''
2) Er...
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
2007 Feb 20
1
error message for record not found ?
...----
Couldn''t find Emrec with ID=1 - (ActiveRecord::RecordNotFound)
C:/InstantRails-1.3/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:955:in `find_one''
C:/InstantRails-1.3/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:941:in `find_from_ids''
C:/InstantRails-1.3/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:382:in `find''
./script/backgroundrb/../../config/../lib/workers/session_worker.rb:20:in `watch_session''
./script/backgroundrb/../../config/../lib/workers/session_worker.rb:12:in...
2006 Jul 11
0
using acts_as_list storing the information in a session
...d
session[:order] = @order
render:partial => ''order_contents''
end
It gives me the following error:
ActiveRecord::RecordNotFound (Couldn''t find Order without an ID):
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:939:in
`find_from_ids''
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/base.rb:382:in
`find''
This is happening with the reload function, which i am assuming tries to
refresh the order_items in the order, by gathering them from the
database.
Is there another way to do th...
2006 May 11
0
Handling instantiate_without_callbacks
...record-1.14.2/
lib/active_record/base.rb:918:in `find_initial''
from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/
lib/active_record/base.rb:952:in `find_one''
from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/
lib/active_record/base.rb:941:in `find_from_ids''
from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/
lib/active_record/base.rb:382:in `find''
from ./nmea_application.rb:66:in `update_state''
from ./nmea_application.rb:45:in `insert_log''
from /opt/local/lib/ruby/gems/1...
2006 Aug 27
0
problem with mysql gem
...verecord-1.14.4/lib/active_record/base.rb:764:in
`sanitize''
from
/usr/local/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:950:in
`find_one''
from
/usr/local/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:941:in
`find_from_ids''
from
/usr/local/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:382:in
`find''
from (irb):3
>>
This is on Centos 4.3, and I''ve tried rebooting just as some posts
suggested.
--~--~---------~--~----~------------~-------~--~...
2006 Aug 07
0
Overloading ''find''
...def find(*args)
options = extract_options_from_args!(args)
validate_find_options(options)
set_readonly_option!(options)
case args.first
when :first then find_initial(options)
when :all then find_every(options)
else find_from_ids(args, options)
end
find_initial(options)
end
end
So it will always return the initial data. In the class, I''m including
myModule.
class klass
include myModule
end
Rails works normally, returning all results instead of the initial. How
do I overload find to i...
2009 Aug 28
0
Error connecting to Sybase (odd)
...ms/activerecord-2.3.2/lib/active_record/base.rb:3103:in
`quoted_table_name''
from
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:1583:in
`find_one''
from
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:1574:in
`find_from_ids''
from
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:616:in
`find''
from (irb):1>>
So it seems that I''m doing something wrong.. But what?
--
Posted via http://www.ruby-forum.com/.
2006 Nov 04
2
strange errors in dev.log and webserver log
...undefined'') LIMIT 1
ActiveRecord::RecordNotFound (Couldn''t find Card with ID=undefined):
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:955:in
`find_one''
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:941:in
`find_from_ids''
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:382:in
`find''
.//app/controllers/cards_controller.rb:36:in `edit''
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:941:in
`perform_action_without_filters'...
2006 Nov 20
4
Production RAILS_ENV / DB Selection
...lib/active_record/base.rb:768:in
`columns_hash''
/var/www/gorchie/releases/20061120100506/config/../vendor/rails/activerecord/lib/active_record/base.rb:1020:in
`find_one''
/var/www/gorchie/releases/20061120100506/config/../vendor/rails/activerecord/lib/active_record/base.rb:1011:in
`find_from_ids''
/var/www/gorchie/releases/20061120100506/config/../vendor/rails/activerecord/lib/active_record/base.rb:416:in
`find''
/var/www/gorchie/releases/20061120100506/lib/workers/upload_process_worker.rb:14:in
`do_work''
/var/www/gorchie/releases/20061120100506/vendor/plugins/back...
2006 Apr 21
2
destory Test Case Messes up all tests
I am trying to create unit tests for my users model but when I add a
test that destroys a user, that user is not available in any of the
other test. If I remove the test that destroys the user all my other
tests work again.
All the fixtures are suppose be reloaded between tests right?
Here is my testcase :
require File.dirname(__FILE__) + ''/../test_helper''
class UserTest
2006 Jun 13
13
Pass infomation between different views and controllers
Hi, I am a rails and ruby nuby :-)
How do you pass data between different controllers and views? I have a
page ( a quote) that I am editing url ....quote/edit/6 6 id the
current id. I then go to a catalog (url....catalog) to add an item to
my quote (I do this via a line_item file that the quote reads) I now
want to go back to the quote. I have tried this
<%= link_to ''Back to
2006 Mar 29
0
Intermittent error - undefined method ''destroy_without_callbacks''
...d/lib/active_record/base.rb:924:in
`find_every''
/vendor/rails/activerecord/lib/active_record/base.rb:918:in
`find_initial''
/vendor/rails/activerecord/lib/active_record/base.rb:952:in `find_one''
/vendor/rails/activerecord/lib/active_record/base.rb:941:in
`find_from_ids''
/vendor/rails/activerecord/lib/active_record/base.rb:382:in `find''
/lib/item_aids.rb:6:in `get_item''
/app/controllers/items_controller.rb:277:in `version''
/vendor/rails/actionpack/lib/action_controller/base.rb:908:in `send''
/ven...
2007 Oct 07
0
Rails AR/Oracle Unit Test: [7769] failed (getting worse)
...query_cache.rb:55:in `select_all''
./test/../lib/active_record/base.rb:439:in `find_by_sql''
./test/../lib/active_record/base.rb:1004:in `find_every''
./test/../lib/active_record/base.rb:1035:in `find_one''
./test/../lib/active_record/base.rb:1021:in `find_from_ids''
./test/../lib/active_record/base.rb:431:in `find''
./test/date_time_test.rb:13:in `test_saves_both_date_and_time''
/usr/pkg/ruby184/lib/ruby/gems/1.8/gems/mocha-0.5.1/lib/mocha/test_case_adapter.rb:19:in `run''
3) Error:
test_default_integers(Default...
2006 Apr 04
3
newbie - HABTM problems writing to Join Table in SQL
I am attempting to document a join between two tables. There seems to be
no writing to my database. Please help me out it is driving me absolutly
crazy.
Basically i''ve got a table of directors that is called when the new/edit
controller model for films is activated. It shows the user a selectable
list of directors they can apply to films. The problem is in the
update/create part. I
2008 Jan 14
0
Controoler/View problem
...find Login With ID=signin" (signin is the method
name) and it then show an error, here is the trace:
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
base.rb:1267:in `find_one''
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
base.rb:1250:in `find_from_ids''
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/
base.rb:504:in `find''
app/controllers/logins_controller.rb:32:in `show''
d:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/
base.rb:1158:in `send''
d:/ruby/lib/ruby/gems/1.8/g...