Sha256: 4a1e9e603c234f1b773f1fa690407113a01f165e41942a9316af19ada73f6b33
Contents?: true
Size: 931 Bytes
Versions: 19
Compression:
Stored size: 931 Bytes
Contents
# you can delete this file if you don't use Rails Test Fixtures fixtures_dir = command_options.try(:[], 'fixtures_dir') fixture_files = command_options.try(:[], 'fixtures') if defined?(ActiveRecord) require "active_record/fixtures" fixtures_dir ||= ActiveRecord::Tasks::DatabaseTasks.fixtures_path fixture_files ||= Dir["#{fixtures_dir}/**/*.yml"].map { |f| f[(fixtures_dir.size + 1)..-5] } logger.debug "loading fixtures: { dir: #{fixtures_dir}, files: #{fixture_files} }" ActiveRecord::FixtureSet.reset_cache ActiveRecord::FixtureSet.create_fixtures(fixtures_dir, fixture_files) "Fixtures Done" # this gets returned else # this else part can be removed logger.error "Looks like activerecord_fixtures has to be modified to suite your need" Post.create(title: 'MyCypressFixtures') Post.create(title: 'MyCypressFixtures2') Post.create(title: 'MyRailsFixtures') Post.create(title: 'MyRailsFixtures2') end
Version data entries
19 entries across 19 versions & 1 rubygems