search for: has_many_polymorphs

Displaying 20 results from an estimated 23 matches for "has_many_polymorphs".

2008 Mar 05
4
has_many_polymorphs is breaking my spec file
Hey folks I have a bunch of classes that are polymorphs, with has_many_polymorphs (they are all ''labellable'', which is similar to being ''taggable'' in the acts_as_taggable scheme). I have a couple of modules, LabellableInstanceMethods and LabellableClassMethods in a file called labellable_methods.rb. The classes all get labelled with '...
2008 Feb 11
3
Should there be trouble w/has_many_polymorphs in a plugin?
Folks, As much as I like generators, I''d greatly prefer to just throw my has_many_polymorphs tagging and commenting engines into projects as plugins. However, after transplanting my tag.rb and tagging.rb files into the lib folder of a ''has_many_tags'' plugin and adding the obligatory plugin requirements (init.rb and an include in environment.rb), I''m not having an...
2010 Mar 23
1
has_many_polymorphs with searchlogic
Has anyone been able to use searchlogic with has_many_polymorphs? Are they compatible? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrai...
2007 Nov 29
0
has_many_polymorphs for user owned tags
Hi all, I''m trying to extend the tagging functionality of has_many_polymorphs to work with user owned tags - ie, putting belongs_to :user in the Tagging model. So I changed the index in the generated migration, and added user_id to the taggings table. Then I added belongs_to :user in the Tagging model. In the lib/tagging_extensions.rb file I added a new function: def...
2008 Mar 05
0
Overloaded has_many_polymorphs method is still being called
I have a has_many_polymorphs class called Property. For the various classes that are polymorphs, i''ve written a module with methods relating to Property, that they can all include. One of my methods is called ''add_properties'': it creates some new associations, but also does a couple of other thing...
2008 Sep 26
0
self-referential tags, has_many_polymorphs
...9;'m looking to add tagging to an application, and I would like to allow self-referential tags, so that I can tag my tags. With the goal of generating a flexible tag hierarchy. After some googling it looks like acts_as_taggable is not the best piece of code, and I''m hoping to use the has_many_polymorphs plugin from http://github.com/fauna/has_many_polymorphs/tree/master. After installing this plugin, and generating a tagging framework using the builtin script/generator tagging ModelA ModelB Tag --self-referential command, I am unable to use the tags, and instead receive the following error...
2007 Nov 14
1
has_many_polymorphs and acts_as_list ?
First, BRAVO for this wonderful plugin: has_many_polymorphs ! Now my problem: 4 models : Collection, Page, Fragment, Belonging (which is the join table): 1 class Collection < ActiveRecord::Base 2 has_many_polymorphs :elements, 3 :through => :belongings, 4 :from => [:pages, :fragments, :collections], 5 :as => :collector,...
2008 Jan 20
2
Which taggable library do people use?
I''d like to add taggability to a model in the site I''m working on, and I wanted to get an idea of what people are using. I keep seeing that acts_as_taggable is deprecated, so I tried the acts_as_taggable_on_steroids. I also tried be_taggable. In any case, I figured I''d see what people use. thanks. -corey -- http://www.coreyhaines.com The Internet''s Premiere
2010 Aug 19
3
Help: "500 Internal Server Error"
...ite then i went through the same process (from 7 to 9) for the back-end admin site as well, and type "rake gems:install" to install any required gems. then start the server, error shows as the following in the log file: ---------------------------------------------------------------- ** has_many_polymorphs: autoload hook invoked ** has_many_polymorphs: preloading parent model Tag ** has_many_polymorphs: associating Tag.taggables [4;36;1mSQL (0.0ms) [0m [0;1mSET NAMES ''utf8'' [0m [4;35;1mSQL (0.0ms) [0m [0mSET SQL_AUTO_IS_NULL=0 [0m [4;36;1mProject Columns (0.0ms) [0m...
2007 May 07
7
A little love for acts_as_taggable #8279
I was working with acts_as_taggable earlier and thought I could make it a bit friendlier. I submitted a ticket and patch #8279. Basically, there are three differences. 1. Fixed the deprecated :dependent => true 2. Added migration generator (it has really specific requirements on table layout, so might as well generate it). 3. Expanded the README to explain using the migration and to include
2007 Aug 02
2
STI functionality, but then with multiple tables
...id column, as they don''t, won''t and shouldn''t be models themselves. As with polymorphic relations, eager load is not an option. I can''t load the url and description info from the links table as I don''t know what type the post will be at query time. Well, has_many_polymorphs [blog.evanweaver.com/pages/has_many_polymorphs] has some nice magic on this as long as you know (define) what subtypes there are. But even then, without eager loading I would be quite happy. Quite happy? I will probably jump for joy!! Thank you for reading, how are your thoughts on this? -- Dax Hu...
2006 May 20
7
Polymorphic, many-to-many, self-referential data model
No matter what I try I''ve been unable to work how to get this to work with the cool ActiveRecord helpers. I''m not sure if it''s possible, Josh Susser''s blog suggests it is, but damned if I can work it out... I have: Container which can contain one or more Element. An Element is a polymorph of either a Container or a Chunk. An Element can exist in one or more
2009 Apr 29
0
Polymorphic comments table needs associated model
...want to display comments with commentable_type = Venue. No problem. But, if I want to display the name of that Venue with the comment... big nasty. The polymorphic key is a composite key and rails doesn''t have a way to recognize this. I really want to keep with Active Record so I tried has_many_polymorphs, which makes finding the venue through the comments table possible but it doesn''t JOIN the venue table with the comments table. So I resorted to writing a sql statement. #User.rb acts_as_commentable has_many_polymorphs :commentables, :from => [:venues, :artists, :events], :through =&...
2012 Jul 31
1
puppet doc questions
...** LOCAL GEMS *** abstract (1.0.0) actionmailer (3.0.15) actionpack (3.0.15) activemodel (3.0.15) activerecord (3.0.15) activeresource (3.0.15) activesupport (3.0.15) ancestry (1.2.5) arel (2.0.10) audited (3.0.0.rc1) audited-activerecord (3.0.0.rc1) builder (2.1.2) diff-lcs (1.1.3) erubis (2.6.6) has_many_polymorphs (3.0.0.beta1) hiera (0.3.0) i18n (0.5.0) jquery-rails (1.0.19) json (1.7.3) mail (2.2.19) metaclass (0.0.1) mime-types (1.19) mocha (0.12.1) mysql (2.8.1) net-ldap (0.3.1) polyglot (0.3.3) puppetlabs_spec_helper (0.2.0) rack (1.2.5, 1.1.0) rack-mount (0.6.14) rack-test (0.5.7) rails (3.0.15) railti...
2008 Jan 18
2
has_many :through with self-referencial AND polymorphism
Hello, despite many readings I still don''t understand how to solve my problem. I have Publication, Picture, File classes A Publication can be related (a one way relation, like a www link) with another Publication, Picture or File I tried this : Publication : has_many :related_elements, :dependent => :destroy, :foreign_key => :publication_id has_many :related, :through =>
2007 Sep 23
3
Connecting a row of an unknown table to another row of an unknown table
...ere that does this? Then I realized that my unified join table vaguely resembled something I remembered reading about in the Agile Web Development using Rails book I picked up not too long ago: polymorphic associations. Intrigued, I looked around on the web for a while and found a plugin "has_many_polymorphs". I''m not sure if this is what I should use though. Could someone give me some pointers on how to pull this trick off? Thanks in advance. -- Elliot Winkler --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Grou...
2009 Nov 12
0
Problem with has_many :through, :uniq => true with polymorph
...pendent => :destroy, :include => :tag has_many :tags, :through => :taggings, :uniq => true This uses the join model Tagging: Tagging belongs_to :tag belongs_to :taggable, :polymorphic => true And of course the Tag model: Tag has_many :taggings, :dependent => :destroy has_many_polymorphs :taggables, :from => [:resources, :lessons], :through => :taggings, :dependent => :destroy The uniq option doesn''t seem to stop me from adding the same tag multiple times to a resource: >> resource = Resource.first => #<TeachingObject id: 59, name: "...
2007 May 15
5
Problem with RJS and/or Prototype.js =>ResponseText is blank
Hi, I''ve got a real head-scratcher. I''ve got a standard Ajax form using form_remote_tag, which calls a controller action which adds a comment and then sends back some JS via RJS which updates a few items on the page. It did work fine but (and I''ve no idea what has happened) now it doesn''t. It calls the controller action but gets an empty response back and
2011 Jul 20
2
polymorphic assoc seems only best for multiple parents ?
I have done a little polymorphic associations stuff and have refreshed my memory on it again. What it seems like is that if I have a particular record and I want to make it easy for many different parent records to associate with it using has_one or has_many, that is fine. If I want a parent record to have multiple kinds of children through one association, I don''t see how to do that
2010 May 25
2
Site Navigation With Polymorphic Has Many Through
Hi, seem to keep running into a wall here. I can''t find any resources on site navigation that can deal with any model being in the nav, allow nesting, and can dynamically update. So I thought about it for a while, and decided on a MenuItems class, which contained the position of the child in relation to it''s siblings, where the parent and the child were polymorphic. Then a given