From ef77d40649b04dff4c935418ef2782c131fc7ef6 Mon Sep 17 00:00:00 2001 From: Carlos Souza Date: Fri, 12 Jul 2013 15:34:52 -0400 Subject: [PATCH] Remove block argument from callback example. [ci skip] --- guides/source/active_record_callbacks.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guides/source/active_record_callbacks.md b/guides/source/active_record_callbacks.md index 2e70e64b39..df1dd22971 100644 --- a/guides/source/active_record_callbacks.md +++ b/guides/source/active_record_callbacks.md @@ -49,8 +49,8 @@ The macro-style class methods can also receive a block. Consider using this styl class User < ActiveRecord::Base validates :login, :email, presence: true - before_create do |user| - user.name = user.login.capitalize if user.name.blank? + before_create do + self.name = login.capitalize if name.blank? end end ``` -- GitLab