Module: Gonzales

Includes:
ActiveSupport::Configurable
Defined in:
lib/gonzales/factories.rb,
lib/gonzales.rb,
lib/gonzales/adapter.rb,
lib/gonzales/version.rb,
lib/gonzales/collection.rb,
lib/gonzales/exceptions.rb,
lib/gonzales/test_helper.rb,
lib/gonzales/adapter/registered.rb,
lib/gonzales/adapter/unregistered.rb,
lib/gonzales/factory_girl/definition_proxy.rb

Overview

Copyright © 2012 Bingo Entreprenøren AS Copyright © 2012 Teknobingo Scandinavia AS Copyright © 2012 Knut I. Stenmark

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Defined Under Namespace

Modules: Adapter, FactoryGirl, TestHelper Classes: Collection, Factories, UndefinedAssociation

Constant Summary collapse

VERSION =
"0.6.1"

Class Method Summary collapse

Class Method Details

.initialize!Object

Runs the initialization of Gonzales. Put this in a rake task for your application.

Example

# lib/tasks/gonzales_tasks.rake
namespace :db do
  namespace :test do
    task :prepare => :environment do
      # place your seeds here, if you have any
      Gonzales.initialize!
    end
  end
end


77
78
79
80
81
82
83
# File 'lib/gonzales.rb', line 77

def self.initialize!
  unless disable_preload
    load(factory_module || Rails.root.join('test', 'speedy.rb'))
  else
    Collection.clear_cache
  end
end