Roberto
Roberto

Reputation: 1089

Rails 3.1 + Mongoid, Embbed model with same name

I'm learning mongodb and rails right now... I have two collection, User and Event

Both User and Event models can have multiple Address, can i use the same model with different views? Or ill need to have two more models???

Upvotes: 1

Views: 81

Answers (1)

apneadiving
apneadiving

Reputation: 115541

You could keep only one Address model. Simply use polymorphism as described here.

Upvotes: 1

Related Questions