新手问题 请教 Product.find (1) 返回问题

tobone · September 03, 2014 · Last by Martin91 replied at September 04, 2014 · 1611 hits

product = Product.find(1) 返回如果是一个 Hash,那么为什么 hash 里面的原有方法都用不了?比如 product.keys

“如果”不成立,返回的是 ActiveRecord instance。

2 Floor has deleted

@Rei 谢谢,看来我被僵尸学误导了,它里面说是 hash。

#3 楼 @tobone 自己多求证,在 console 里边执行product.class不就清清楚楚了吗

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