假设我有两个模型
class User
embeds_many :notifications
field :age, type :Integer
class Notification
embedded_in :user
field :message, type: String
我想创建通知并将其添加到符合特定条件的所有用户。我想到的就是:
notification = Notification.new
notification.message = "Hello"
User.where(:age.ge => 18).push(:notifications,
错误:
Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in
配置:
; For Win32 only.
SMTP = localhost
smtp_port = 25
; For Win32 only.
sendmail_from =