similar to: Adding methods to Object in Rails -- WARNING

Displaying 20 results from an estimated 3000 matches similar to: "Adding methods to Object in Rails -- WARNING"

2006 May 19
2
Problems at running Rails at the first time
Well, i got familiar with writing Ruby scripts the last days and thougt to write a web application with a framework. First steps was Rails. I successfully installed Gems, Action Web Service and Rails, at least the installer said so... :D So I took a tutorial to write a small app, but I fail in the step startig Rails with the command "rails myappdir". There are some warnings and error
2006 Jan 03
2
Newbie Install Question
Hi, I''ve been trying to get rails going on one of our dedicated servers, with no luck. I have ruby installed, gems, etc... When i goto to create my first rails app i get this: rails test /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/ associations/association_proxy.rb:6: warning: instance_methods: parameter will default to ''true'' as of 1.8.1
2007 Nov 26
0
rSpec (rev 2996), Rails (rev 8214): TextMate bundle problems
Hey guys, I''m trying to get rSpec (rev 2996) working with Rails 2 (rev 8214). Running the tests from the command line works, no problem. I installed the RSpec.tmbundle (also rev 2996), and would like to see the HTML test results in TextMate. When I run the "Run examples in selected files/directories" command in TextMate, I get the following dump:
2005 Mar 02
3
uprgrade to 0.10: uninitialized constant Class::Object
Hi, I installed rails 0.10 with ruby gem, and upgraded my application as described at http://manuals.rubyonrails.com/read/book/15 . Now, when accessing the action index of the controller rss_feed, I get this error in the terminal when I started the server: #<NameError: uninitialized constant Class::Object>
2007 Aug 22
1
mock framework ethics question
Hi James, Jim, and everyone else who''s listening. I''ve been investigating an interesting bug related to mocks and rails AssociationProxies. See http://rubyforge.org/tracker/?func=detail&atid=3149&aid=12547&group_id=797 for details. The crux is that if you do this (rspec mock syntax): obj.should_receive(:msg).with(mock_of_a_model) and the implementation does
2008 Feb 22
2
marshaling ActiveRecord objects: how to unload associations?
I''m marshaling ActiveRecord objects, and I want them to be as small as possible. How can I unload everything that can be reloaded from the database? If they''re marshaled before any of the associations are referenced then the referenced objects aren''t dumped. But if the association has been loaded, how can I unload it? AssociationProxy.reset doesn''t seem to do
2006 Mar 10
0
WEBrick crashing
ruby 1.8.2 (2004-12-25) [i386-mswin32] latest version of edge rails - patched to make the server work with win32 (http://dev.rubyonrails.org/ticket/4139) On some pages WEBrick is crashing with the following: d:/programming/ruby/lib/ruby/1.8/profiler.rb:27: You have a nil object when you didn''t expect it! (NoMethodError) You might have expected an instance of Array. The error occured
2007 Jun 28
1
DRb server crashing
I''m having a problem where the DRb server seems to be disappearing (crashing?) and I don''t know how to track down the cause or work around the problem. Unfortunately I haven''t found a way to reproduce the problem, but it seems to happen fairly often (maybe once a day). Other then that ferret seems to be working well. I can''t seem to find any trace of the
2006 Jul 31
3
Polymorphic associations and single table inheritance
Running into an interesting problem that at first glance appears to be a bug in the AR association code. However, it''s explicitly coded this way so I''m not so sure. I have some code like this: class Address < ActiveRecord::Base belongs_to :addressable, :polymorphic => true end class Person < ActiveRecord::Base has_many :addresses, :as => :addressable,
2006 Nov 22
2
.class call to the mock object (or any existing methods)
Hi I run into problem trying to set expectations for the mockobject.class method, I had to undefine a method before I could set some expectation. Is there any better way of doing it? object = mock() .... klass = class <<object; self; end klass.send(:undef_method, "class") # I had to do this because Mocha utilizes "method_missing(symbol, *arguments, &block) "
2007 Jan 10
3
ActiveRecord Error?
We spent a big chunk of yesterday hunting down a strange bug in one of our rails apps and created a test project to try out different theories on what was going on. The result so far is a very small test case app that perfectly reproduces the problem. The question is, is there anything *wrong* with what we''re doing here, or is it a problem with ActiveRecord? We''re on rails
2006 Nov 20
5
RMagick load problems?
I have a page (model: daily_progress_chart) that uses RMagick and ImageMagick to create a chart using RVG. A few days ago (after some updates to Rails), this chart stopped working on both my development machine (MacBook Pro) and the production server (Gentoo Linux). I get the following error messages. I am totally lost, but I assume that there is a problem with RMagick. Any ideas anyone? On
2006 Apr 16
8
"Cannot convert String to Integer" after using association
So, I''ve written a partial that does some stuff with a given instance of my class "entity". Entity is ActiveRecord. I''m able to retrieve all sorts of data from an @entity, until I do something like: <% for @attribute in @entity.attributes %> <div id="attribute_<%= @attribute.id %>"> <%= render(:partial =>
2007 Aug 18
0
RSpec and acts_as_attachment
Hey guys, I''m getting a weird error when trying to test something like the following. It''s a model that is using acts_as_attachment but the weird thing is the equivalent Test::Unit case passes. Does anyone have any ideas? Best, Dave # it was a Test::Unit case first def test_should_be_invalid_without_file UserFile.any_instance.expects(:with_image).never
2005 Oct 27
0
has_one with Single Table Inheritance - NameError : uninitialized constant
I am having a problem with using SIngle Table Inheritance with a has_one relationship, and I am at a loss of what could be causing it. Below is the related code and the error message. class User < ActiveRecord::Base has_one :wishlist end class List < ActiveRecord::Base belongs_to :user end class Wishlist < List has_and_belongs_to_many :items, :class_name =>
2006 Mar 20
2
AHHHhhhhh... has_and_belongs_to_many, that is going on?
I don''t have a class by the name of "ReviewersScoreCard", yet my many to many configuration looks as follows. And, these errors while running some simple test with ./script/console is giving me a headache: ./script/console Loading development environment. >> r = Reviewer.find_first => #<Reviewer:0x19d0a48 @attributes={"id"=>"1",
2007 Jan 02
4
allow stubbing of previously defined methods such as "id"
On my current project I needed to create a stub that responded correctly to the id message. Here''s the change I put into my copy of head. Index: lib/mocha/mock_methods.rb =================================================================== --- lib/mocha/mock_methods.rb (revision 1114) +++ lib/mocha/mock_methods.rb (working copy) @@ -68,6 +68,7 @@ method_names =
2007 Oct 10
9
Rspec Textmate bundle errors
Hello all, Having a problem with the Rspec textmate bundle and having quizzed the guys in #textmate to no success about the errors, I''ve been suggested to try you guys! When I run the "Run Behaviour Description" command, I get the following errors: /Users/alastair/Library/Application Support/TextMate/Bundles/ RSpec.tmbundle/Support/lib/spec/../spec/mate/runner.rb:34:in
2006 Mar 13
0
Problems with association named :task
I have an object that belongs_to :task, and calling that object''s task method returns the task it belongs to in the unit tests. One place in a controller, though, it gives me the error: undefined method `find'' for Rake::Task:Class ./script/../config/../vendor/rails/activerecord/lib/active_record/associations/belongs_to_association.rb:44:in `find_target''
2006 Dec 20
4
undefined method `fullname' for #<User:0x357e380>, BUT works on first view?
Hi all, Please excuse the long post, but I wanted to make sure you have all the information.... I have a NewsModel that looks like this: class News < ActiveRecord::Base belongs_to :user validates_associated :user validates_length_of :title, :description, :minimum => 5, :allow_nil => false acts_as_commentable acts_as_taggable def self.find_recent News.find(:all,