JSON没有出现在回报率
问题描述:
从色器件user表中的所有字段我尝试检索的JSON哈希sign_in_count场JSON没有出现在回报率
data = User.where customer: current_user.id
render :json => data
它只返回字段:ID,姓名,电子邮件,创建/更新和客户,但而不是其余的表格字段。这是Devise中的配置设置吗?
在user.rb我有:
devise
:database_authenticatable,:registerable,:recoverable,:rememberable,
:trackable, :validatable, :confirmable, :lockable, :zxcvbnable,
:timeoutable
答
这并获得成功。
data.as_json(:force_except => Devise::Models::Authenticatable::BLACKLIST_FOR_SERIALIZATION.delete_if{|x| x == :sign_in_count})