标签: ruby-on-rails arrays ruby-on-rails-4 rails-activerecord ruby-on-rails-4.1
Class User < ActiveRecord::Base serialize :pets, Array end
如何创建可链接查询,我想要排除用户,例如已经&#34; cat&#34;在序列化的pets属性中?
pets
答案 0 :(得分:0)
User.where.not("pets = ?", ["cat"].to_yaml)