Skip to content
This repository
Browse code

Remove useless code in #attribute_present? since 0 != blank?. Closes #…

…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...
commit 8296c680d5f026b755ae1555933474d4be8c3377 1 parent bc97a87
risk danger olson authored
4  activerecord/CHANGELOG
... ...
@@ -1,5 +1,9 @@
1 1
 *SVN*
2 2
 
  3
+* Remove useless code in #attribute_present? since 0 != blank?.  Closes #7249 [Josh Susser]
  4
+
  5
+* Fix minor doc typos. Closes #7157 [Josh Susser]
  6
+
3 7
 * Fix incorrect usage of #classify when creating the eager loading join statement.  Closes #7044 [Josh Susser]
4 8
 
5 9
 * SQLServer: quote table name in indexes query.  #2928 [keithm@infused.org]
4  activerecord/lib/active_record/associations.rb
@@ -98,7 +98,7 @@ def clear_association_cache #:nodoc:
98 98
     # ActiveRecord associations can be used to describe relations with one-to-one, one-to-many
99 99
     # and many-to-many cardinality. Each model uses an association to describe its role in
100 100
     # the relation. In each case, the belongs_to association is used in the model that has
101  
-    # the foreign key
  101
+    # the foreign key.
102 102
     #
103 103
     # === One-to-one
104 104
     #
@@ -119,7 +119,7 @@ def clear_association_cache #:nodoc:
119 119
     #     has_many :employees
120 120
     #   end
121 121
     #   class Employee < ActiveRecord::Base
122  
-    #     belongs_to :manager     # foreign key - employee_id
  122
+    #     belongs_to :manager     # foreign key - manager_id
123 123
     #   end
124 124
     #
125 125
     # === Many-to-many
2  activerecord/lib/active_record/base.rb
@@ -1712,7 +1712,7 @@ def attributes_before_type_cast
1712 1712
       # nil nor empty? (the latter only applies to objects that respond to empty?, most notably Strings).
1713 1713
       def attribute_present?(attribute)
1714 1714
         value = read_attribute(attribute)
1715  
-        !value.blank? or value == 0
  1715
+        !value.blank?
1716 1716
       end
1717 1717
 
1718 1718
       # Returns true if the given attribute is in the attributes hash

0 notes on commit 8296c68

Please sign in to comment.
Something went wrong with that request. Please try again.