hstore postgres Rails4的语法错误

时间:2013-09-19 14:06:32

标签: ruby-on-rails postgresql ruby-on-rails-4 heroku-postgres

您好我有一个postgres语法错误,我似乎无法在使用HSTORE时跟踪

ERROR:

2.0.0p247 :021 > e.save                                                                                                                                                                                                                        
   (218.8ms)  BEGIN                                                                                                                                                                                                                            
  SQL (219.8ms)  INSERT INTO "communications" ("created_at", "incoming", "properties", "type", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"  [["created_at", Thu, 19 Sep 2013 23:49:14 EST +10:00], ["incoming", true], ["propertie
s", "{\"to\":\"First email test!\"}"], ["type", "Email"], ["updated_at", Thu, 19 Sep 2013 23:49:14 EST +10:00]]                                                                                                                                
PG::InternalError: ERROR:  Syntax error near 'e' at position 13                                                                                                                                                                                
: INSERT INTO "communications" ("created_at", "incoming", "properties", "type", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id"                                                                                                       
   (218.4ms)  ROLLBACK 

当我尝试保存电子邮件记录时,错误来自rails控制台,在我的应用程序中,电子邮件继承自通信模型,并且记录存储在数据库的“通信”表中。

模型:

class Communication < ActiveRecord::Base
    belongs_to :patient
    belongs_to :practice
end

和...

class Email < Communication
    store_accessor :properties, :to, :cc, :bcc, :message, :subject
end

1 个答案:

答案 0 :(得分:0)

不确定为什么但是几天之后可能数据库或服务器重启已经修复了问题...非常感谢您的帮助@ user647622