aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source
diff options
context:
space:
mode:
authorEileen M. Uchitelle <eileencodes@gmail.com>2016-03-04 16:01:11 -0500
committerEileen M. Uchitelle <eileencodes@gmail.com>2016-03-04 16:01:11 -0500
commita327e62c2fef43848d6e86e73778e6c1fd58ad9b (patch)
tree3be2d7497875fe3b6bd4be7eeeb9d15673ebe5dc /guides/source
parent28a6571bae1d6bc1c774e8e501720374061a31f1 (diff)
parent3de932281a36e138b332eff55aa5c2a9ac7b8bbd (diff)
downloadrails-a327e62c2fef43848d6e86e73778e6c1fd58ad9b.tar.gz
rails-a327e62c2fef43848d6e86e73778e6c1fd58ad9b.tar.bz2
rails-a327e62c2fef43848d6e86e73778e6c1fd58ad9b.zip
Merge pull request #24061 from perceptec/update-engines-guide
Fix author callback in engines guide [ci skip]
Diffstat (limited to 'guides/source')
-rw-r--r--guides/source/engines.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/guides/source/engines.md b/guides/source/engines.md
index c5fc2f73b4..eafac4828c 100644
--- a/guides/source/engines.md
+++ b/guides/source/engines.md
@@ -799,7 +799,7 @@ before the article is saved. It will also need to have an `attr_accessor` set up
for this field, so that the setter and getter methods are defined for it.
To do all this, you'll need to add the `attr_accessor` for `author_name`, the
-association for the author and the `before_save` call into
+association for the author and the `before_validation` call into
`app/models/blorgh/article.rb`. The `author` association will be hard-coded to the
`User` class for the time being.
@@ -807,7 +807,7 @@ association for the author and the `before_save` call into
attr_accessor :author_name
belongs_to :author, class_name: "User"
-before_save :set_author
+before_validation :set_author
private
def set_author
@@ -1209,7 +1209,7 @@ module Blorgh::Concerns::Models::Article
attr_accessor :author_name
belongs_to :author, class_name: "User"
- before_save :set_author
+ before_validation :set_author
private
def set_author