aha, now I have replicated this with another model, comments! guess what 
these two have in common? They're both polymorphic! Here's my model code, 
maybe I'm doing something wrong?

class Comment < ActiveRecord::Base

  hobo_model # Don't put anything above this

  fields do

    body :text

    timestamps
  end
  
  belongs_to :author, :class_name => "User"
  belongs_to :commentable, :polymorphic => true


class Event < ActiveRecord::Base

  hobo_model # Don't put anything above this
  has_event_calendar

  fields do
      start_at    :datetime
      end_at        :datetime
      description    :text
      eventable_id    :integer 
      eventable_type    :string
      all_day :boolean
      color :string

    timestamps
  end
  has_many :event_tags, :through => :event_taggings
  belongs_to :eventable, :polymorphic => true 
 
    def name
        if self.eventable_type == "User"
            self.eventable.name + " : " + self.description
        else
            self.description
        end
    end

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" 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/hobousers?hl=en.

Reply via email to