similar to: Anything wrong with this test? Cannot access fixture

Displaying 20 results from an estimated 1000 matches similar to: "Anything wrong with this test? Cannot access fixture"

2005 Apr 24
2
Model names in controllers
Please excuse yet another newbie question... I''m getting this error: MissingSourceFile in <controller not set>#<action not set> c:/program files/ruby/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/dependencies.rb:75:in `require_dependencies'': Missing model MyModel.rb From these lines of code: class MyModelController < ApplicationController
2006 May 19
1
FileColumn
I''m using Windows and Postgres 8. I installed RMagic gem thingy and FileColumn plugin ok. I followed instructions exactly as directed on FileColumn web site which is very straight forward: ---model class My_model < ActiveRecord::Base file_column :column_for_file_name end -----view -upload form--set to mulitpart <%= file_column_field "my_model",
2006 Jul 02
2
Fixtures Problem
I''m having a problem configuring fixtures -- for some reason, when I run my unit test, I''m not getting any of the instance variables that are advertised in "Agile Web Development with Rails". I''ve gone through various Wikis and Google, and it seems like I''m the only person with this problem. There is no error message per se, but when I try to use the
2011 Dec 25
1
Fixtures vs Fixture class, what is the intended purpose?
Hello, i am trying to fix the code for fixtures in rails because it is buggy and internal variable names are confusing, could somebody please explain to me what is the intended purpose of Fixture and Fixtures classes respectively? For example, why do we need both `Fixtures.initialize`and `Fixture.initialize`? They both "initialize" a single fixture, and in fact `Fixture.initialize`
2007 May 21
7
How do I stop a column being updated by model.save?
One of my models has a column that is updated very frequently from a separate process, so it is important that when a record is saved in rails, this column should be left alone. In the update method of the controller I have: @record = MyModel.find(params[:id]) @record.update_attributes(params[:my_model]) params[:my_model] doesn''t have a reference to the column I''m talking
2005 Apr 10
2
residuals in VGAM
Hi all: I want to fit a multinomial logit model with VGAM package, however I cannot find a way to check the residuals since residuals(my_model) and resid(my_model) does not work. Any suggestions? Thanks in advance. Alex Brito [[alternative HTML version deleted]]
2008 Jan 31
6
loading fixtures?
How do you load fixtures from specs as you would test? eg. rake db:fixtures:load RAILS_ENV=development -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20080131/38c3b0ab/attachment.html
2017 Jun 26
3
Jagged ROC curves?
Hi, I was trying to draw some ROC curves (prediction of case/control status), but seem to be getting a somewhat jagged plot. Can I do something that would 'smooth' it somewhat? Most roc curves seem to have many incremental changes (in x and y directions), but my plot only has 4 or 5 steps even though there are 22 data points. Should I be doing something differently? How can I provide a
2017 Jun 26
0
Jagged ROC curves?
> On Jun 26, 2017, at 11:40 AM, Brian Smith <bsmith030465 at gmail.com> wrote: > > Hi, > > I was trying to draw some ROC curves (prediction of case/control status), > but seem to be getting a somewhat jagged plot. Can I do something that > would 'smooth' it somewhat? Most roc curves seem to have many incremental > changes (in x and y directions), but my plot
2006 Jul 31
3
Missing controller default code
Hello, I generated a controller, using the command: ruby script/generate controller my_kontroller my_model The generated controller file, however, contains an empty class definition. The default controller code is missing. Any idea what went wrong? Thanks, gk -- Posted via http://www.ruby-forum.com/.
2010 Nov 03
2
[klaR package] [NaiveBayes] warning message numerical 0 probability
Hi, I run R 2.10.1 under ubuntu 10.04 LTS (Lucid Lynx) and klaR version 0.6-4. I compute a model over a 2 classes dataset (composed of 700 examples). To that aim, I use the function NaiveBayes provided in the package klaR. When I then use the prediction function : predict(my_model, new_data). I get the following warning : "In FUN(1:747[[747L]], ...) : Numerical 0 probability with
2006 Jul 14
3
override to_string for single attribute?
I have a model where I want to change the display for a single attribute such that if the value is an integer, it displays with no decimal point (e.g. "1"), but if it is non-integer, it displays with a decimal point (e.g. "1.25"). The easiest way to do this seems to be if I could override the to_string method for my_model.my_attribute.to_s. Is there a way to do this? Or
2008 Mar 05
2
Testing that a model helper method is called
So, I have a plugin that adds a method to ActiveRecord::Base, let''s call the method is_encrypted. class MyModel < ActiveRecord::Base is_encrypted end So, my question is, how do I write a spec to show that is_encrypted is called here? I would rather not write specs that say that the behavior is there, since I have tested the behavior already in my plugin. Thanks. -Corey --
2006 May 08
7
How to get difference between two dates in days???
Hi, I want to calculate difference between Current date & previous date (stored in database). The difference should be in days. Hhow to do that?? PLs tell me. Thanx in advance. Prash -- Posted via http://www.ruby-forum.com/.
2006 Sep 22
2
Editing the migration template
Hi. I''d like to edit the generated template in AR where tables are created. for example, this file is created when generating a new model or migration: class CreateModel < ActiveRecord::Migration def self.up create_table :models do |t| # t.column :type, I''d like to edit the above so it''ll generate this: class CreateModel <
2006 May 31
1
ActiveRecord: When / where to validate data? Tricky question
First of all, thanks for you time. I have kind of a tricky question and wanted to see what you guys thought. ------------------------------------------- Lets say I have this: ------------------------------------------- class Purchase < ActiveRecord::Base validates_numericality_of :some_number, :only_integer => true end ------------------------------------------- Then I do this:
2006 Dec 14
1
create and destroy fixture manually in method
Hi, My test case has two fixtures and eight methods. But one of the eight methods need one more fixture. How do I solve this? Okay, I put the additional fixture in common place so every method has additional access to the additional fixture. The problem is the additional fixture depend on that two fixtures (foreign key). When I run the test, it complains something like this:
2006 Jul 29
3
Validating two models
Hi, I have a model Account wich "has_one" model called UserData. Both models use validation. # Model contains user name, email etc. class Account < ActiveRecord::Base has_one :user_data, :foreign_key => "user_id" validates_presence_of :email end # Model contains firstname, lastname etc. class UserData < ActiveRecord::Base
2007 Jun 03
0
fixtures outside of rails
Hi, Is anyone using fixtures in unit tests for applications using ActiveRecord outside of rails? I found an example to do this from some old threads. They cite as an example: http://opensvn.csie.org/ezra/rails/ez_where_two/test/test_helper.rb However, I copied this exactly and can still not get fixtures to work by putting ''fixtures :my_model'' at the top of my test class. They
2006 Jun 13
2
Locating an arbitrary fixture...
Is there a good way to get an arbitrary fixture from the generated fixture function? I need a way to get one of my fixtures, I don''t care which one. It doesn''t need to be random and could always return the same fixture. This is part of a support function for custom assertions and it doesn''t know what class its working on, let alone what fixture names are possible.