Skip to content

Commit

Permalink
exists? is deprecated in ruby trunk [ci skip]
Browse files Browse the repository at this point in the history
see here 4d4ff53
  • Loading branch information
raysrashmi committed Nov 1, 2013
1 parent 1478ebf commit 49062c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions guides/source/active_record_callbacks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions guides/source/initialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ The `APP_PATH` constant will be used later in `rails/commands`. The `config/boot
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)

require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
```

In a standard Rails application, there's a `Gemfile` which declares all
Expand Down Expand Up @@ -121,7 +121,7 @@ when 'server'
# Change to the application's path if there is no config.ru file in current directory.
# This allows us to run `rails server` from other directories, but still get
# the main config.ru and properly set the tmp directory.
Dir.chdir(File.expand_path('../../', APP_PATH)) unless File.exists?(File.expand_path("config.ru"))
Dir.chdir(File.expand_path('../../', APP_PATH)) unless File.exist?(File.expand_path("config.ru"))

require 'rails/commands/server'
Rails::Server.new.tap do |server|
Expand Down

0 comments on commit 49062c1

Please sign in to comment.