我已经升级到Padrino应用程序上的最新Ruby,并且在创建新对象时出现了活动记录错误。它将一个数字( ISBN)验证为4个字节。错误是:
9781407005416 is out of range for ActiveRecord::Type::Integer with limit 4
如何告诉Ruby活动记录类使用8字节限制?
我说的不是运行迁移,表已经是bigint(20)了。
我认为以下几点是可行的:
class Book < ActiveRecord::Base
attribute :isbn, :integer, :limit => 8
end
然后,我得到了
给定以下记录(第一行是列名):
name platform other_columns date
Eric Ruby something somedate
Eric Objective-C something somedate
Joe Ruby something somedate
如何检索带有所有列的单一记录,以便名称列在结果集中总是唯一的?我