aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails_generator
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails_generator')
-rw-r--r--railties/lib/rails_generator/commands.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/railties/lib/rails_generator/commands.rb b/railties/lib/rails_generator/commands.rb
index f8a7e706a3..2da82f545d 100644
--- a/railties/lib/rails_generator/commands.rb
+++ b/railties/lib/rails_generator/commands.rb
@@ -217,6 +217,7 @@ module Rails
# passed a block then the source file is a template that needs to first
# be evaluated before being compared to the destination.
def identical?(source, destination, &block)
+ return false if File.directory? destination
source = block_given? ? File.open(source) {|sf| yield(sf)} : IO.read(source)
destination = IO.read(destination)
source == destination