title: factory_girl undefined method `save!' for
body: <pre><code>## app/models/armor_type.rb
  class ArmorType &lt; ActiveRecord::Base
    validates :name, presence: true
  ...
  end
  
  ## spec/models/armor_type_spec.rb
  require 'rails_helper'
  RSpec.describe ArmorType, type: :model do
    it "has a valid name" do
      armor_type = create(:armor_type)
    end
  end
  
  ## spec/factories/armor_types.rb
  FactoryGirl.define do
    factory :armor_type do
      name "cloth"
    end
  end
  
  ## spec/support/factory_girl.rb
  RSpec.configure do |config|
    config.include FactoryGirl::Syntax::Methods
  end
  
  ## spec/rails_helper.rb
  ENV['RAILS_ENV'] ||= 'test'
  require File.expand_path('../../config/environment', __FILE__)
  abort("The Rails environment is running in production mode!") if     Rails.env.production?
  require 'spec_helper'
  require 'rspec/rails'
  require 'support/factory_girl'
  require 'capybara/rspec'
  
  ## Gemfile
  group :development, :test do
    gem 'byebug'
    gem 'rspec-rails'
    gem 'factory_girl_rails'
  end
  </code></pre>
  
  <p>I can't seem to get factory_girl to work properly. I created at testApp using a SQLite3 test database and it worked, however using my current application which uses a PostgreSQL test database I get the following error;</p>
  
  <pre><code>          1) ArmorType has a valid name
               Failure/Error: armor_type = create(:armor_type)
               NoMethodError:
                 undefined method `save!' for #&lt;ArmorType:0x000000071a8b58 @name="cloth"&gt;
               # ./.bundle/gems/factory_girl-4.5.0/lib/factory_girl/configuration.rb:14:in `block in initialize'
               # ./.bundle/gems/factory_girl-4.5.0/lib/factory_girl/evaluation.rb:15:in `[]'
               # ./.bundle/gems/factory_girl-4.5.0/lib/factory_girl/evaluation.rb:15:in `create'
               # ./.bundle/gems/factory_girl-4.5.0/lib/factory_girl/strategy/create.rb:12:in `block in result'
               # ./.bundle/gems/factory_girl-4.5.0/lib/factory_girl/strategy/create.rb:9:in `tap'
               # ./.bundle/gems/factory_girl-4.5.0/lib/factory_girl/strategy/create.rb:9:in `result'
               # ./.bundle/gems/factory_girl-4.5.0/lib/factory_girl/factory.rb:42:in `run'
               # ./.bundle/gems/factory_girl-4.5.0/lib/factory_girl/factory_runner.rb:23:in `block in run'
               # ./.bundle/gems/activesupport-4.2.3/lib/active_support/notifications.rb:166:in `instrument'
               # ./.bundle/gems/factory_girl-4.5.0/lib/factory_girl/factory_runner.rb:22:in `run'
               # ./.bundle/gems/factory_girl-4.5.0/lib/factory_girl/strategy_syntax_method_registrar.rb:20:in `block in define_singular_strategy_method'
               # ./spec/models/armor_type_spec.rb:6:in `block (2 levels) in &lt;top (required)&gt;'
               # .bundle/binstubs/rspec:16:in `load'
               # .bundle/binstubs/rspec:16:in `&lt;main&gt;'
  </code></pre>
  
  <p>I've gone ahead and created another test app using a PostgreSQL test database and I get the same errors. Any help would be appreciated.</p>
  
  <p>Cheers!</p>