开发者

If I can call SomeClass with some_class, then how can I call Module::SomeClass?

开发者 https://www.devze.com 2023-03-11 18:54 出处:网络
Post is accessible via Blog.first.posts How do I do this with a module name space? Such as 开发者_运维知识库Engine::Post

Post is accessible via

Blog.first.posts

How do I do this with a module name space? Such as 开发者_运维知识库Engine::Post

Blog.first.???

Thanks


Try explicitly giving Mongoid the class name

class Engine::Blog
  include Mongoid::Document

  embeds_many :posts, :class_name => "Engine::Post"
end
0

精彩评论

暂无评论...
验证码 换一张
取 消