diff options
Diffstat (limited to 'activerecord/lib/active_record/fixtures/file.rb')
-rw-r--r-- | activerecord/lib/active_record/fixtures/file.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/fixtures/file.rb b/activerecord/lib/active_record/fixtures/file.rb index 9e95007f40..beda5a65df 100644 --- a/activerecord/lib/active_record/fixtures/file.rb +++ b/activerecord/lib/active_record/fixtures/file.rb @@ -32,7 +32,9 @@ module ActiveRecord private def rows return @rows if @rows - @rows = YAML.load(render(IO.read(@file))).to_a + + data = YAML.load(render(IO.read(@file))) + @rows = data ? data.to_a : [] end def render(content) |