# Easy before\_update question (i hope)

**URL:** <https://www.ruby-forum.com/t/easy-before-update-question-i-hope/152943>\
**Category:** Rails\
**Created:** [November 10, 2008, 10:02am UTC](https://www.ruby-forum.com/t/easy-before-update-question-i-hope/152943 "2008-11-10T10:02:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![scottnj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b9e5f3/32.png) [@scottnj](https://www.ruby-forum.com/u/scottnj)\
**Post date:** [November 10, 2008, 10:02am UTC](https://www.ruby-forum.com/t/easy-before-update-question-i-hope/152943/1 "2008-11-10T10:02:48Z")

</div>

in a before\_update is there an easy way to check if a specific field  
is being changed?

for example

def before\_update  
unless current.email == new.email  
# do stuff  
end  
end

obviously “current.email” and “new.email” are wrong. i am guessing one  
will be “self.email”, what would the other be?

---

<div class="post-metadata">

**Author:** ![scottnj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b9e5f3/32.png) [@scottnj](https://www.ruby-forum.com/u/scottnj)\
**Post date:** [November 10, 2008, 11:08am UTC](https://www.ruby-forum.com/t/easy-before-update-question-i-hope/152943/2 "2008-11-10T11:08:43Z")

</div>

On 10 Nov 2008, at 09:02, scott wrote:

> end
> 
> obviously “current.email” and “new.email” are wrong. i am guessing one  
> will be “self.email”, what would the other be?

from 2.1 onwards you’ll get an email\_changed? method for free.

Fred
