search for: association_proxi

Displaying 20 results from an estimated 64 matches for "association_proxi".

Did you mean: association_proxy
2006 Mar 24
1
Bug (or feature?) in association_proxy: attributes in conditions
Hi List, When I do something like belongs_to :thing, :conditions => ''var = #{my_var}'' method_missing in association_proxy.rb gets recursively called. Are these bind-style vars not allowed? Given the code in the conditions method of association_proxy.rb, it looks lilke they''re meant to be. I''m running -v 4021 of rails. Cheers, Ian
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 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 =>
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 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
2009 Jul 20
2
Hitting unknown error with "can't dup NilClass"
Hi, My system has been encounter this problem, and I couldn''t find solution after debugging. My scenario is stated below: class user has_many :posts has_many :comments end class post belongs_to :user has_many :comments, :as => :commentable end class comment belongs_to :post belongs_to :user end For this case, I am trying to retrieve each post''s comment
2006 Apr 06
4
Record retrieval in Many-to-many using :through not working
Hello, I get an error while retrieving records from the following model structure. Tables foods - id, food foodallergies - food_id, symptom_id, a few other columns symptoms - id, symptom Models class Food < ActiveRecord::Base has_many :foodallergies has_many :symptoms, :through => :foodallergies end class Symptom < ActiveRecord::Base has_many :foodallergies has_many :foods,
2006 Jul 24
2
Thread.new with ActiveRecord under Mongrel vs. FastCGI
Hi All, I''m going to end up hosting a site on a server in a fastcgi environment, but I''ve been doing most of my development under mongrel. I have a bit of code that spawns a thread, and in the thread it makes some remote calls (openuri) and does some database inserts via activerecord. When I do this under FastCGI, everything appears to work as expected. When I do it under
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 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,
2009 Jun 04
1
wrong number of arguments (1 for 0)
Hi, I hope someone can help me because this is driving me crazy, I''ve spent hours trying to track this down. I''m trying to convert a Rails 1.1 to Rails 2.3.2 and I''m getting the following error when trying to save a many to many relationship. I''ve double checked all the associations, I''ve used console to test my models and they all work ok, I can do
2009 Nov 17
5
has_many :through and foo.bars.include?
hallo everybody, i already googled the following problem, but there are so many questions regarding "has_many :through", that i just couldn''t find what i was looking for. so, i''m really sorry if this has been asked before. if so, just drop me the link. i have a has_many :through relationship similar to the following example: class Group < ActiveRecord::Base
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''
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 May 20
1
acts_as_paranoid overrides ActiveRecord::Base??
Guys, I am trying to figure out what exactly does this line do at the end of "acts_as_paranoid" plugin? ActiveRecord::Base.send :include, Caboose::Acts::Paranoid::ActiveRecord My problem: I have some classes that I use acts_as_paranoid, and others with tagging support. Classes declared as taggable, throw error, which appears to be in the acts_as_paranoid version of the
2010 Aug 30
1
taskomatic.rb : set_vm_vnc_port
Hi, Does somebody know what is the purpose of this line in taskomatic.rb : set_vm_vnc_port(db_vm, result.description) unless result.status != 0 We removed it to avoid 2 errors in taskomatic.log when a vm is launched : ERROR Mon Aug 30 15:23:00 +0000 2010 (26416) Task action processing failed: ActiveRecord::RecordInvalid: Validation failed: Vnc port must be greater than or equal to 0 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 May 28
1
upload_column problems on post after validation error
Hi to all the crew ! I''ve a little (big ?) problem. I''m using upload_column plugin, it works very well but it throws an exception when I try to repost the form after a validation error. Here some details: Model: (hostel.rb) HOSTEL_PHOTO_DIR = Proc.new {|inst, attr| "hostel/#{inst.id}"} HOSTEL_PHOTO_THUMB = "100x100" HOSTEL_PHOTO_NORMAL =
2006 Mar 27
2
:through and STI
Hi, I''m trying to use :through and STI using the trunk version of Rails, but I get the following error see bottom of this msg[1] here are my classes. class Player < ActiveRecord::Base end class Ladder < ActiveRecord::Base has_many :subscriptions has_many :players, :through => :subscriptions end class SingleLadder < Ladder end class Subscription <
2007 Jul 17
5
habtm confusion
Hello friends! I am trying to make a database that will have a group of people set to committees, and a person can be in multiple committees, and a committee obviously has multiple people. The people are senators at my university. These are my current models: senator.rb: -- class Senator < ActiveRecord::Base validates_presence_of :first_name, :last_name, :floor has_and_belongs_to_many