Rails 碰上了 undefined method `read_inheritable_attribute' for Record:Class

birbird · September 26, 2013 · Last by luikore replied at September 30, 2013 · 2304 hits

用 MongoMapper 连 MongoDB,不继承 ActiveRecord 了,

Model 类是这样的,

class Record
  include MongoMapper::Document

  key :order_id, String
  key :pnr,  Integer

end

在 Controller 里 new 的时候就报了 undefined method `read_inheritable_attribute' for Record:Class

def new
  @record = Record.new
end 

这是咋回事啊,谢啦先!

用 mongoid 的话应该人比较多一点...

You need to Sign in before reply, if you don't have an account, please Sign up first.