Skip to content

Commit

Permalink
Remove useless code in #attribute_present? since 0 != blank?. Closes #…
Browse files Browse the repository at this point in the history
…7249 [Josh Susser]. Fix minor doc typos. Closes #7157 [Josh Susser]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6018 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
technoweenie committed Jan 23, 2007
1 parent bc97a87 commit 8296c68
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions activerecord/CHANGELOG
@@ -1,5 +1,9 @@
*SVN*

* Remove useless code in #attribute_present? since 0 != blank?. Closes #7249 [Josh Susser]

* Fix minor doc typos. Closes #7157 [Josh Susser]

* Fix incorrect usage of #classify when creating the eager loading join statement. Closes #7044 [Josh Susser]

* SQLServer: quote table name in indexes query. #2928 [keithm@infused.org]
Expand Down
4 changes: 2 additions & 2 deletions activerecord/lib/active_record/associations.rb
Expand Up @@ -98,7 +98,7 @@ def clear_association_cache #:nodoc:
# ActiveRecord associations can be used to describe relations with one-to-one, one-to-many
# and many-to-many cardinality. Each model uses an association to describe its role in
# the relation. In each case, the belongs_to association is used in the model that has
# the foreign key
# the foreign key.
#
# === One-to-one
#
Expand All @@ -119,7 +119,7 @@ def clear_association_cache #:nodoc:
# has_many :employees
# end
# class Employee < ActiveRecord::Base
# belongs_to :manager # foreign key - employee_id
# belongs_to :manager # foreign key - manager_id
# end
#
# === Many-to-many
Expand Down
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/base.rb
Expand Up @@ -1712,7 +1712,7 @@ def attributes_before_type_cast
# nil nor empty? (the latter only applies to objects that respond to empty?, most notably Strings).
def attribute_present?(attribute)
value = read_attribute(attribute)
!value.blank? or value == 0
!value.blank?
end

# Returns true if the given attribute is in the attributes hash
Expand Down

0 comments on commit 8296c68

Please sign in to comment.