aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/persistence.rb
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-11-19 12:50:44 -0200
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-11-19 12:52:20 -0200
commit3b99653587cead2f8b6ba4ee163c8b736d5f7f34 (patch)
tree58a66147eaa1f38c45d9b06904752b0e7ee91993 /activerecord/lib/active_record/persistence.rb
parent7e10f38880fb0907d0bb61e996b76aedc6f1641e (diff)
downloadrails-3b99653587cead2f8b6ba4ee163c8b736d5f7f34.tar.gz
rails-3b99653587cead2f8b6ba4ee163c8b736d5f7f34.tar.bz2
rails-3b99653587cead2f8b6ba4ee163c8b736d5f7f34.zip
Remove not needed begin..end from AR#save
Diffstat (limited to 'activerecord/lib/active_record/persistence.rb')
-rw-r--r--activerecord/lib/active_record/persistence.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb
index 45f5406cc3..1c17c578e9 100644
--- a/activerecord/lib/active_record/persistence.rb
+++ b/activerecord/lib/active_record/persistence.rb
@@ -72,11 +72,9 @@ module ActiveRecord
# +save+ returns +false+. See ActiveRecord::Callbacks for further
# details.
def save(*)
- begin
- create_or_update
- rescue ActiveRecord::RecordInvalid
- false
- end
+ create_or_update
+ rescue ActiveRecord::RecordInvalid
+ false
end
# Saves the model.