2012-09-16 45 views

回答

1

您在balanced_customer中一直发生错误。你为什么不添加一些有条件的陈述?

例子:

raise "Balanced Card: #{balanced_card_uri} Email: #{email}" if balanced_card_uri.blank? && email.blank? 

不管怎么说,这是不是继续,您应该使用验证的方式。例如:

validates :balanced_card_uri, presence: true 

检查this page,了解更多信息。


旁注:你为什么不加入recurring_amountrecurringattr_accessible


侧面旁注:

替换:

before_save :handle_recurring_donations, :if => :recurring 

有了:

before_save :handle_recurring_donations, :if => :recurring? 

这个问题似乎从find_or_initialize_by_repeat_donator干:你不拿任何参数考虑在那里。

你应该有这样一行:

customer.load(attrs) 

所有你想保持PARAMS。

+0

是的,我知道我一直在提出这个错误。我有意在开发中进行调试。 – tbrooks

+0

好的,您创建客户的代码是什么? – apneadiving

+0

这仍然不能解决我的截图中发生的问题。 – tbrooks