aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-xactiverecord/lib/active_record/associations.rb4
-rwxr-xr-xactiverecord/lib/active_record/base.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb
index bd84bc8247..fc43dabbfa 100755
--- a/activerecord/lib/active_record/associations.rb
+++ b/activerecord/lib/active_record/associations.rb
@@ -98,7 +98,7 @@ module ActiveRecord
# 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
#
@@ -119,7 +119,7 @@ module ActiveRecord
# 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
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index b8a497ffa3..4686b583e8 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -1712,7 +1712,7 @@ module ActiveRecord #:nodoc:
# 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