Use Rails 4 find_by in README [ci skip]
This commit is contained in:
parent
1fc294f988
commit
21df476f4c
|
@ -98,7 +98,7 @@ Example:
|
||||||
|
|
||||||
class Mailman < ActionMailer::Base
|
class Mailman < ActionMailer::Base
|
||||||
def receive(email)
|
def receive(email)
|
||||||
page = Page.find_by_address(email.to.first)
|
page = Page.find_by(address: email.to.first)
|
||||||
page.emails.create(
|
page.emails.create(
|
||||||
subject: email.subject, body: email.body
|
subject: email.subject, body: email.body
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue