我遇到問題Rolify。當我使用命令耙分貝:補種的外殼,重置我的數據庫我有這樣的錯誤:Ruby on rails rake db:reseed abort
undefined local variable or method `rolify' for Customer:Class
這裏是我的代碼在我的模型與Rolify:如果你知道爲什麼
class Customer
include Mongoid::Document
include Mongoid::Timestamps
rolify
embeds_one :contact
has_many :orders
devise :database_authenticatable, :recoverable, :registerable, :timeoutable, :validatable,
:token_authenticatable, :confirmable
attr_accessible :email, :password, :password_confirmation, :add_role
field :first_name
field :last_name
field :password
field :gender
field :confirmed_at
field :unconfirmed_email
field :confirmation_url
field :confirmation_token
field :confirmation_sent_at
field :email
field :encrypted_password
gender_regex = /^(Male|Female)$/
validates :first_name, presence: true, :allow_blank => true
validates :last_name, presence: true, :allow_blank => true
validates :password, presence: true
validates :gender, presence: true, :allow_blank => true,
format: { with: gender_regex }
end
,請幫助我:)
什麼是'rolify'命令?它做什麼以及它來自哪裏? –
這是爲角色跟上https://github.com/EppO/rolify – user967001