【问题标题】:Active Record save methods throws Cannot visit RSpec::Matchers errorActive Record 保存方法抛出无法访问 RSpec::Matchers 错误
【发布时间】:2011-10-08 07:46:00
【问题描述】:

我有这段代码使用 ruby​​ 和活动记录

customer_email = Email.first(:conditions => {:Email_Address => email_address})
  customer_email.Is_Verified = 1
  customer_email.save!

在线:customer_email.save!,我收到如下错误:

无法访问 RSpec::Matchers::Matcher (TypeError)

我不明白为什么会出现此错误。我认为这与电子邮件表中的 Is_Verified 列有关。我无法重命名此列,因此我将不胜感激。

【问题讨论】:

    标签: ruby activerecord rspec matcher


    【解决方案1】:

    如果你在保存前puts customer_email.inspect 会发生什么?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-07-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多