Rails script/generate skip unnecessary files by default

rails-generaterspecrubyruby-on-rails

Script/generate became very annoying since I started using rspec etc. I dont need unit test files and fixtures anymore, but script/generate makes them anyway.

Is it possible to set --skip-fixtures and --skip-test to be default system-wide (or at least project-wide)?

Best Solution

You can edit your applications script/generate file to auto append options

#!/usr/bin/env ruby

ARGV << "--skip-fixture" if ["model"].include?(ARGV[0])

require File.dirname(__FILE__) + '/../config/boot'
require 'commands/generate'