diff options
author | Chris Beer <cabeer@stanford.edu> | 2014-05-11 19:26:21 -0700 |
---|---|---|
committer | Chris Beer <cabeer@stanford.edu> | 2014-05-11 19:26:45 -0700 |
commit | ff5e8f9a24c0505ae17888be82a65fb9c864bffe (patch) | |
tree | aebb83f1d0aae8f13269ec6903eb42bb60f7ef2b /activerecord/lib | |
parent | bab48f0a3d53a08bc23ea0887219e8deb963c3d9 (diff) | |
download | rails-ff5e8f9a24c0505ae17888be82a65fb9c864bffe.tar.gz rails-ff5e8f9a24c0505ae17888be82a65fb9c864bffe.tar.bz2 rails-ff5e8f9a24c0505ae17888be82a65fb9c864bffe.zip |
correcting method documentation [ci skip]
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb index 4b1733619a..5b4043039b 100644 --- a/activerecord/lib/active_record/attribute_methods.rb +++ b/activerecord/lib/active_record/attribute_methods.rb @@ -326,13 +326,13 @@ module ActiveRecord # class Task < ActiveRecord::Base # end # - # person = Task.new(title: '', is_done: false) - # person.attribute_present?(:title) # => false - # person.attribute_present?(:is_done) # => true - # person.name = 'Francesco' - # person.is_done = true - # person.attribute_present?(:title) # => true - # person.attribute_present?(:is_done) # => true + # task = Task.new(title: '', is_done: false) + # task.attribute_present?(:title) # => false + # task.attribute_present?(:is_done) # => true + # task.title = 'Francesco' + # task.is_done = true + # task.attribute_present?(:title) # => true + # task.attribute_present?(:is_done) # => true def attribute_present?(attribute) value = read_attribute(attribute) !value.nil? && !(value.respond_to?(:empty?) && value.empty?) |