similar to: Polymorphic associations

Displaying 20 results from an estimated 2000 matches similar to: "Polymorphic associations"

2006 Aug 02
10
Ruby deamon
We are building a web-based application with Ruby on Rails and MySQL backend. The client now wants us to add various workflow features that will eventually expand into SOAP web services. These workflow features include tasks such as automatically sending reminders for due tasks, or if a particular set of information hasn''t been logged by a certain time to automatically send an email
2006 Feb 18
3
Edit in Place
I need help using In Place Editor by script.aculo.us #controller def my_action #get the text to display initially @fancy_text = "Some fancy *bold* and _emphasized_ text." end def update_text #save your text here, and return the saved value @fancy_text = params[:value] render :layout => false, :inline => "<%= textilize( @fancy_text ) %>" end
2006 Feb 17
7
Rich Text Editor (RTE)
Hello, We are developing an commercial application that need to use an RTE. Someone know one RTE editor that can I use in an commercial application? We need basic functions to format paragrapher, bold, italic, ... I found FCKEditor but it is very expensive and weight. I found this list too but don''t know what is trustful: http://www.geniisoft.com/showcase.nsf/WebEditors Some
2011 May 03
2
Database performance for polymorphic associations under high load
Hey guys, I''ve been thinking lately about polymorphic associations, and I wonder: is there a noticeable or tangible performance "hit" from doing polymorphic associations when you''ve got your database under really high query load? So for example, maybe I have a "message" model, a "user" model and an "administrator" model, without any
2006 Jul 26
1
Polymorphic Associations: dynamic finders
Is there any sort of dynamic finder for polymorphic associations? For example if I had: class InviteNode < ActiveRecord::Base belongs_to :inviteable, :polymorphic => true end I would like to be able to search by: InviteNode.find_by_inviteable(some_object) instead of having to do: InviteNode.find_by_inviteable_id_and_inviteable_type(some_object.id, some_object.class.name) obviously I
2006 Mar 31
2
Eager loading of polymorphic associations
Polymorphic associations work great until I try to do some eager loading through :include. In my example, the interface name is ":imagehaver". Here''s my little eagerly loading find line: Image.find(params[:id], :include => :imagehaver) All it gives me is an ActiveRecord::EagerLoadPolymorphicError with no further explanation. I haven''t been able to dig up anything
2006 Feb 10
3
[Req] polymorphic associations howto
Hi people, I''m looking into polymorphic associations as a way to cleanup some messy parts of my code. I think they will allow me to do exectly what I need, but since there''s little to none written on this subject, I''d be delighted if someone could shed some light on this. Especially what the different options and needed table structures need to be. Thanks, -
2008 Apr 11
1
polymorphic associations wrong when used with inherited class?
Consider the following: class Event belongs_to :event_object, :polymorphic => true end class Asset < ActiveRecord::Base end class EventedAsset < Asset has_one :event, :as => :event_object end EventedAsset.find(:first).event generates the following SQL: SELECT * FROM `events` WHERE (events.event_object_id = 1 AND events.event_object_type = ''Asset'') LIMIT 1
2007 Jan 27
1
Polymorphic Associations or not
Hey, I am starting my store application again for the 3rd time, I am just trying to get eveything right so that I don''t come up with any more complex problems later. Hopefully someone can steer me in the right direction. I have a store that sells lots of types of product. e.g. CDs, T-Shirts, DVD Each product type has different associations. Cds - multiple artists, multiple genres,
2006 Jul 10
2
Polymorphic associations in reverse?
My app has an association that''s got me scratching my head. I have Users, and Images. A User has many Images. (Yes, another picture sharing app, but it''s for a small niche, and it doesn''t end in -r!) I would like to express a "Favorite" relationship between both Users to Users, and Users to Images. This seems like the opposite of the standard
2006 May 18
0
Sorting Polymorphic Associations
Recently, I converted a single table inheritance design over to polymorphic associations as that made a lot more sense from a database perspective. One of the features of the ui, a drag and dropable list of items, needs to be completely reworked though. Instead of having one table with a "sort" column, I have 1 polymorphic table "items" acting as a pointer to 3 or 4 other
2008 Jan 04
1
eager loading and polymorphic associations
There is a dedicated section about eager loading in the docs. A coworker discovered eager loading does not work in polymorphic associations the hard way :-) so I''ve written a patch that documents it: http://dev.rubyonrails.org/ticket/10610 There are at least a couple of tickets that implement something that would change that though: http://dev.rubyonrails.org/ticket/9640
2008 Jun 13
1
Polymorphic :through associations
Could someone please help me with this association scheme? I am familiar with habtm as well as the :through association but this one has me stumped. Here is an example DB. Tags Table: ------------------------- id name Taggables Table: -------------------------- id tag_id taggble_type taggable_id For purposes of this example say that there are 2 other tables that can be tagged and their model
2008 Apr 23
2
Bug in eager loading and polymorphic associations?
Hi friends, i''m usgin the edge version because i need eager loading on polymorphic associations support, but i see this: Message.find(:first, :include => :owner) #This generate this query: SQL (0.000072) SET SQL_AUTO_IS_NULL=0 Message Load (0.000389) SELECT * FROM `messages` User Load (0.001070) SELECT * FROM `users` WHERE (users.id IN (1,2)) And this Message.find(:first,
2006 Aug 16
1
Naming rights_roles join model using has_many :through and polymorphic associations
Hi. I have a couple of best practices questions regarding polymorphic associations, naming join tables and user permissions. Currently I have implemented the user authentication model from the rails recipes book. Basically it goes something like this: MODEL CLASSES: class User < ActiveRecord::Base has_and_belongs_to_many :roles end class Role < ActiveRecord::Base
2007 Oct 27
0
STI vs Polymorphic Associations
I have a MasterEvent model. It has attributes that is required by another model Event. The user selects the MasterEvent model and I create the Event model by merging the attributes of the selected MasterEvent with the attributes that were presented for the Event model in the form. I have association declarations in the MasterEvent and Event models. If I use STI does the subclasses inherit the
2006 Sep 17
0
[RFC] Nested Restful Resources + Polymorphic Associations
hi, how to handle the problem addressed in this thread: http://rails.techno-weenie.net/question/2006/9/6/nested-restful-resources-polymorphic-associations is there any consensus on this? any comments, suggestions? thanks, _c -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google
2008 Oct 06
0
Mistaking with polymorphic associations?!
Hello, I''m trying to solve a problem without success. Look at: I have 3 models (Recipe, Comments and User) an Recipe has many Comments an User has many Comments an User has many Recipes I tried to implement this using polymorphic associations with the Comment model. But the expected behavior needs to be: When a new comment is created i need to refer it in Recipe and Comments. To
2008 Apr 21
2
Eager Loading Polymorphic Associations
Hi, I''m searching for a method of eager loading polymorphic associations under activerecord 2.0.2. After some initial google-fu I came up with a link to an enhancement that''s been added to edge: http://dev.rubyonrails.org/ticket/8119 Anyone have any idea how long that might take to work its way into a general release? I''m early in development now so I can afford to
2006 Feb 09
2
Polymorphic Associations
If anybody on edge familiar with this could help, that would be "great" :) I have different types of things I want to be "reviewable". So, instead of having a slew of HABTM... this new Polymorphic Associations schtick seemed like the best solution. I have everything setup as I thought it should be (so I think)... but it doesn''t appear to be working correctly. Here