我想我正试图让PHP等价print_r()(打印人类可读); 目前原始产量是:
ActiveRecord::Relation:0x10355d1c0
Run Code Online (Sandbox Code Playgroud)
我该怎么办?
如何获得模型的所有关系.IE,我有User型号:
class User < AR::Base
has_many :messages, :foreign_key => 'author'
has_many :posts
belongs_to :role
end
Run Code Online (Sandbox Code Playgroud)
那么我怎么知道User模型有哪些关系呢?和foreign_keys如果被呈现.