Permalink
Browse files

Merge pull request #24061 from perceptec/update-engines-guide

Fix author callback in engines guide [ci skip]
  • Loading branch information...
eileencodes committed Mar 4, 2016
2 parents 28a6571 + 3de9322 commit a327e62c2fef43848d6e86e73778e6c1fd58ad9b
Showing with 3 additions and 3 deletions.
  1. +3 −3 guides/source/engines.md
View
@@ -799,15 +799,15 @@ 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.
```ruby
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

0 comments on commit a327e62

Please sign in to comment.