Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Single Table Inheritance Association Issue

Reply
Thread Tools

Single Table Inheritance Association Issue

 
 
Mike
Guest
Posts: n/a
 
      03-12-2007
Hi there,

I'm using STI in a new application, and something is terribly wrong with
has_many associations.

Right, so I have number of subclasses that inherit from one concrete
base class. Each sub class can possibly have associations via has_many,
or has_one. When I try to access a collection on the sub class(
subclass.items), I get 'undefined method 'items' for <Subclass>'. The
strange thing is, accessing these subclasses in script/console works
fine, and even works the first time I run the app in some cases. Once I
refresh the page I get this error though.

I'm totally at a loss here. Any help would be greatly appreciated!

Thanks in advance.

Mike.

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Phrogz
Guest
Posts: n/a
 
      03-12-2007
On Mar 12, 10:02 am, Mike <(E-Mail Removed)> wrote:
> I'm using STI in a new application, and something is terribly wrong with
> has_many associations.

[snip]
> I'm totally at a loss here. Any help would be greatly appreciated!


You have posted this question to the ruby-talk forum/newsgroup/mailing
list, which is for general discussion of the Ruby language. You will
probably get a better set of responses if you ask this question on the
ruby-on-rails forum/group, which is for rails-specific questions, as
yours is.

http://groups.google.com/group/rubyonrails-talk

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find by association table Greg Ma Ruby 4 02-16-2010 06:33 AM
Newbie quesiton about inheritance single table Tobias Ruby 1 01-21-2007 01:09 PM
Modified Single Table Inheritance Ryan Glover Ruby 8 12-31-2006 05:08 PM
Question on inheritance & association, pls help.. krislioe@gmail.com Java 1 10-04-2006 11:10 AM
Stange mp3 file association issue... k Computer Support 4 08-07-2003 05:22 AM



Advertisments