class User < ActiveRecord::Base
has_attached_file :avatar,
:styles => {
:micro => "32x32#",
:thumb => "50x50#",
:big_thumb => "80x80#",
:small => "220x220>",
:featured => "220x220#",
:medium => "600x600>"
}
end
如何为具有附加头像的用户搜索用户模型?
答案 0 :(得分:3)
假设您在用户上有一个名为“avatar_file_name”的列,那么
User.scoped({:conditions => 'avatar_file_name IS NOT NULL'})
应该这样做