我正在学习rails.我发现Devise非常适合快速无缝地进行身份验证,但我确实有一个问题.
如何在第一次运行Devise发生器后更改模块(例如rails g devise User)?此默认值为以下迁移:
def self.up
create_table(:users) do |t|
t.database_authenticatable :null => false
t.recoverable
t.rememberable
t.trackable
# t.confirmable
# t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
# t.token_authenticatable
t.timestamps
end
add_index :users, :email, :unique => true
add_index :users, :reset_password_token, :unique => true
# add_index :users, :confirmation_token, :unique => true
# add_index :users, :unlock_token, :unique => true
end
Run Code Online (Sandbox Code Playgroud)
如果我运行此迁移,如何在以后添加/删除其中一些模块?例如,也许我想为现有的用户模型添加可锁定功能.我理解如何在模型中进行更改,devise.rb但我不确定如何处理迁移.
抱歉,如果答案已经在这里,我已经在这里和谷歌拖了几个小时,找不到任何东西.也许我正在寻找错误的东西.
提前致谢!
杰森
ps.我正在使用
rails 3.0.0
设计1.1.3
以下测试中的第3个失败:
specify { (0.6*2).should eql(1.2) }
specify { (0.3*3).should eql(0.3*3) }
specify { (0.3*3).should eql(0.9) } # this one fails
Run Code Online (Sandbox Code Playgroud)
这是为什么?这是浮点问题还是ruby或rspec问题?
我正在与Docusign Connect合作并愉快地接收活动.最近我正在查看文档,并注意到了requireAcknowledgement标志,我正在努力实现这一点并取得了成功.通常,当我收到连接事件时,我会返回一个空体200.但在翻转该标志后,事件将落入Connect失败日志中并显示错误消息:"error": "https://scrubbed/ :: Error - Envelope Id returned does not match, returned data: 200 OK"
所以,按照诊断顺序:
requireAcknowledgement布尔值时,所有事件都会进入连接失败日志,并显示有关信封ID不匹配的错误.由于我没有在身体中发回信封ID,这似乎是正确的requireAcknowledgement我可以再次获得状态更改而无需其他更改.这是我的Connect Config:
{
"connectId": "xxx",
"urlToPublishTo": "https://{snip}/",
"name": "POST everything to test webhook",
"allowEnvelopePublish": "true",
"enableLog": "true",
"includeDocuments": "false",
"includeCertificateOfCompletion": "false",
"requiresAcknowledgement": "true",
"signMessageWithX509Certificate": "true",
"useSoapInterface": "false",
"includeTimeZoneInformation": "true",
"includeEnvelopeVoidReason": "false",
"includeSenderAccountasCustomField": "true",
"envelopeEvents": "Sent,Delivered,Signed,Completed,Declined,Voided",
"recipientEvents": "Sent,Delivered,Completed,Declined",
"soapNamespace": "",
"allUsers": "true",
"includeCertSoapHeader": "false"
}
Run Code Online (Sandbox Code Playgroud)
感谢您提供任何帮助!
我有朋友要求我制作网站,而且大多数都非常小,通常我不打扰技术计划,但特别是一位朋友显然有比我自己更大的目标,而且项目正在拖延下去.如果我在项目之前做了一个规范,我觉得这不会发生,我们的关系会像以前一样坚实.
所以我的问题是,你怎么能说出小有多小?你怎么知道你正在开始的项目什么时候会在一个充满内疚的范围内陷入噩梦?