search for: belongs_to_association

Displaying 11 results from an estimated 11 matches for "belongs_to_association".

2005 Oct 27
0
has_one with Single Table Inheritance - NameError : uninitialized constant
...activesupport-1.2.1/lib/active_support/dependencies.rb:198:in `const_missing'' g:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.12.1/lib/active_record/associations/association_proxy.rb:11:in `initialize'' g:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.12.1/lib/active_record/associations/belongs_to_association.rb:6:in `eval'' g:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.12.1/lib/active_record/associations/association_proxy.rb:11:in `initialize'' g:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.12.1/lib/active_record/associations/belongs_to_association.rb:6:in `initialize'' g:/ruby/l...
2009 Jul 20
2
Hitting unknown error with "can't dup NilClass"
...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-2.3.2/lib/active_record/ associations/association_proxy.rb:240:in `load_target'' /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/ associations/association_proxy.rb:112:in `reload''...
2007 Feb 08
5
a possible bug in Has_many :through using :soucre
...iationTypeMismatch: User expected, got User from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2 /lib/active_recor d/associations/association_proxy.rb:148:in `raise_on_type_mismatch'' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2 /lib/active_recor d/associations/belongs_to_association.rb:22:in `replace'' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2 /lib/active_recor d/associations.rb:900:in `user='' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2 /lib/active_recor d/base.rb:1673:in `attributes='' from c:/ruby/lib...
2006 Jul 28
3
Forms: handle foreign keys (AssociationTypeMismatch)
...ails112.locobundle/powerpc/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/associations/association_proxy.rb:134:in `raise_on_type_mismatch'' /Applications/Locomotive2/Bundles/rails112.locobundle/powerpc/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/associations/belongs_to_association.rb:22:in `replace'' /Applications/Locomotive2/Bundles/rails112.locobundle/powerpc/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/associations.rb:850:in `country='' /Applications/Locomotive2/Bundles/rails112.locobundle/powerpc/lib/ruby/gems/1.8/gems/activerecord-1.14....
2006 Mar 13
0
Problems with association named :task
...o :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'' ./script/../config/../vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:106:in `load_target'' ./script/../config/../vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:32:in `reload'' ./script/....
2008 Sep 02
1
Deploying Rails patches (diff)
I am having a problem with a belongs_to and a has_one :through relation which I found is a known bug in Ruby on Rails: http://rails.lighthouseapp.com/projects/8994/tickets/323-has_many-through-belongs_to_association-bug This ticket has 6 different attachments. Do I need all of them, or just the latest one? I can''t seem to find anywhere how one is supposed to deploy these patches. Preferably I would patch something in my project that overrides the installed rails stack as opposed to patching the insta...
2009 Feb 02
4
AssociationTypeMismatch got Fixnum
...mongrel on the second) I got this error: ActiveRecord::AssociationTypeMismatch (Source expected, got Fixnum): /vendor/rails/activerecord/lib/active_record/associations/ association_proxy.rb:150:in `raise_on_type_mismatch'' /vendor/rails/activerecord/lib/active_record/associations/ belongs_to_association.rb:22:in `replace'' [...] The fact that scares me *a lot* is that I get it on random basis and reloading the page solves it. It looks like that sometimes the record isn''t retrieved correctly from the db but instead it got a fixnum. The fact that is a random behaviour doesn'...
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
2010 Jul 16
31
Added associations but don't see generated methods
Hi, I''ve got a Rails app working that includes two two classes, etc.: Expense & Vendor. I eventually learned that the mental concept I had of their relationship should be express in Rails as: class Expense < ActiveRecord::Base; belongs_to :vendor; end class Vendor < ActiveRecord::Base; has_many :expenses; end
2006 Nov 26
5
associations help?
I have Users who can "own" Projects. There is only one owner. Users in general can be authorized to view certain projects. Here is my initial stab at this: class User < ActiveRecord::Base has_many :projects # ownership has_many :project_viewers, :dependent => :destroy has_many :projects, :through => :project_viewers, :uniq => true ... end class
2005 Aug 25
1
newbie questions about hosting address
...this: /usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/associations/association_proxy.rb:93:in `raise_on_type_mismatch'': Entity expected, got Entity (ActiveRecord::AssociationTypeMismatch) from /usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/associations/belongs_to_association.rb:25:in `replace'' from /usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/associations.rb:628:in `src_entity='' from /usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/associations.rb:621:in `src_entity='' As you can see, it expects a class o...