この協会に問題があります。
前:
has_many :membership, class_name: 'Profile', conditions: "profiles.role != 'owner'"
現在、属性「役割」は文字列ではなく、配列になっているため、「役割」が ['所有者'] ('所有者' ではない) であるレコードになる条件を変更する必要がありますが、配列を使用することはできません。試合。
欲しかった:
has_many :memberships, class_name: 'Profile', conditions: "profiles.role != ['owner']"
プロファイル モデル
class Profile < ActiveRecord::Base
attr_accessible :role
serialize :role, Array
belongs_to :account
def roles?(role)
role.include?(role)
end
end