public Method

Base.attribute_present?(attribute)

Returns true if the specified attribute has been set by the user or by a database load and is neither nil nor empty? (the latter only applies to objects that respond to empty?, most notably Strings).

Source Code

# File active_record/base.rb, line 2166
def attribute_present?(attribute)
  value = read_attribute(attribute)
  !value.blank?
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.