aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/active_record_callbacks.md
diff options
context:
space:
mode:
Diffstat (limited to 'guides/source/active_record_callbacks.md')
-rw-r--r--guides/source/active_record_callbacks.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/guides/source/active_record_callbacks.md b/guides/source/active_record_callbacks.md
index 5cc6ca5798..ac5e8ffc0c 100644
--- a/guides/source/active_record_callbacks.md
+++ b/guides/source/active_record_callbacks.md
@@ -290,7 +290,7 @@ Here's an example where we create a class with an `after_destroy` callback for a
```ruby
class PictureFileCallbacks
def after_destroy(picture_file)
- if File.exists?(picture_file.filepath)
+ if File.exist?(picture_file.filepath)
File.delete(picture_file.filepath)
end
end
@@ -310,7 +310,7 @@ Note that we needed to instantiate a new `PictureFileCallbacks` object, since we
```ruby
class PictureFileCallbacks
def self.after_destroy(picture_file)
- if File.exists?(picture_file.filepath)
+ if File.exist?(picture_file.filepath)
File.delete(picture_file.filepath)
end
end