Have you defined your model as a subclass of user in routes?

On May 30, 8:52 am, angrysponge <[email protected]> wrote:
> I have a Game model which I would like to enable comments for. Games
> are owned by Members, which is a subclass of User. The relevant model
> code needed thus far:
>
> class Game < ActiveRecord::Base
>   belongs_to :member
>   acts_as_commentable
>   def owner
>     self.member.becomes(User)
>   end
>
> class Member < User
>   has_many :games
>
> Saving a comment for a Game generates this error:
> NoMethodError in CommentsController#create
> undefined method `user_game_url' for #<CommentsController:0xb6daef9c>
>
> When adding a comment to a Photo, polymorphic_url() returns
> 'user_photo_url', so 'user_game_url' looks reasonable, except that
> Users don't own Games, Members do.
>
> Am I missing some route details for my Game model?
>
> Any suggestions?
> Mike
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CommunityEngine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/communityengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to