hobo conflicts with acts_as_taggable
Reported by Jakub Suder | October 10th, 2008 @ 02:17 PM
I've installed acts_as_taggable_on_steroids plugin, and adding acts_as_taggable call to a hobo model causes an exception during server startup. This happens because acts_as_taggable adds a polymorphic association to the model:
has_many :taggings, :as => :taggable
Tagging is a class provided by the plugin, which "belongs_to :taggable, :polymorphic => true". Now, during startup, the server generates drymls (dryml_generator.rb), and in pages.dryml.erb it looks for the model's associations to add any possible new_for_(owner) pages. Then it calls model.reverse_reflection(:taggings), and that method throws an exception because it's unable to track the whole association path, because it's polymorphic.
Proposed solution: Hobo should be able to notice that this association is polymorphic and ignore it - either in pages.dryml.erb, or in reverse_reflection().
Steps to reproduce:
1. hobo newproject, cd newproject
2. script/plugin install
http://svn.viney.net.nz/things/rails/plugins/acts_as_taggable_on_st...
3. script/generate hobo_model_resource document name:string
4. script/generate acts_as_taggable_migration
5. script/generate hobo_migration (and migrate)
6. add "acts_as_taggable" line to app/models/document.rb
7. script/server --> throws "uninitialized constant
Tagging::Taggable (NameError)"
Comments and changes to this ticket
-
Tom Locke October 14th, 2008 @ 05:05 PM
- State changed from new to resolved
These missing polymorphic classes crop up all over the place (because Hobo performs so much reflection) so I've been meaning to have them spring into existence automatically as required. See #83
I've just implemented that in d2012b2
Your problem seems to be fixed too.
Thanks for reporting this.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »