0
我有一个ActiveRecord before_save
方法抛出一个奇怪的错误:PostgreSQL的ActiveRecord的怪事了。最大
class MyThing < ActiveRecord::Base
before_save :dostuff
def dostuff
p self.class.maximum(:mycolumn)
end
end
当我使用SQLite这个完美工作,现在已经在PostgreSQL-我得到的错误:
PGError: ERROR: current transaction is aborted, commands ignored until end of transaction block : SHOW max_identifier_length
.maximum
方法在dostuff
方法之外工作,所以我想我只是一次要求太多?是否有另一种方法来获得将在before_save
内工作的整数列的最大值?
看起来问题实际上是因为我在迁移过程中遇到了一些PostgreSQL不友好的术语,这意味着实际上并不需要表。非常奇怪的错误信息,考虑到寿... – 2010-04-21 10:34:25