添加此代码
def send_messages
return if recipient_list.blank?
recipient_list.each do |recipient|
recipient = User.find(recipient)
messages.build(user_id: recipient.id, conversation_id: self.id)
end
对我的模型
class Conversation < ActiveRecord::Base
attr_accessible :recipient_list
after_create :send_messages
has_many :messages
end
导致对我的模型的任何引用抛出
syntax error, unexpected $end, expecting keyword_end
从模型...没有它我的模型工作得很好。这段代码有问题吗?