views:

15

answers:

1

What's the recommended way to do the following:

class Property
  include MongoMapper::Document

  key :key
  key :value

  belongs_to :post
end

class Post < ActiveRecord::Base
  has_many :properties
end

Does that work (testing now)?

Update, adding this to ActiveRecord is a start:

ActiveRecord::Base.class_eval do
  def new?
    new_record?
  end
end
A: 

It can't works. But you need made yourself your association. Create all method to you need and use it.

shingara