[英]acl9 doesn't fill created_at
I followed the acl9 Readme exactly, have double checked everything and still get the following error when trying to use has_role!(:admin)
. 我完全遵循了acl9自述文件,仔细检查了所有内容,并在尝试使用has_role!(:admin)
时仍然收到以下错误。
ActiveRecord::StatementInvalid: SQLite3::ConstraintException: roles_users.created_at may not be NULL: INSERT INTO "roles_users" ("user_id", "role_id") VALUES (1, 1)
The only catch is that I am using Rails 3.2 and used the following fix for an error: Rails 3.2 undefined method `key?' 唯一的问题是我正在使用Rails 3.2并针对错误使用了以下修复程序: Rails 3.2 undefined method`key?' for nil:NilClass 对于nil:NilClass
Any suggestions? 有什么建议么?
This is a known issue in rails. 这是Rails中的一个已知问题。 Hopefully it will be resolved and reported on here . 希望它将在这里得到解决和报告。
I fixed it by eliminated the has_and_belongs_to_many
lines from the corresponding model class, and for some reason that made it go away. 我通过消除相应模型类中的has_and_belongs_to_many
行来修复它,并且由于某种原因使它消失了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.