Class: RSpec::Rails::ActiveRecordConfiguration
Relationships & Source Files | |
Inherits: | Object |
Defined in: | rspec-rails/lib/rspec/rails/active_record.rb |
Overview
Class Method Summary
- .initialize_activerecord_configuration(config) Internal use only Internal use only
Class Method Details
.initialize_activerecord_configuration(config)
This method is for internal use only.
[ GitHub ]
# File 'rspec-rails/lib/rspec/rails/active_record.rb', line 7
def self.initialize_activerecord_configuration(config) config.before :suite do # This allows dynamic columns etc to be used on ActiveRecord models when creating instance_doubles if defined?(ActiveRecord) && defined?(ActiveRecord::Base) && defined?(::RSpec::Mocks) && (::RSpec::Mocks.respond_to?(:configuration)) ::RSpec::Mocks.configuration. do |possible_model| target = possible_model.target if Class === target && ActiveRecord::Base > target && !target.abstract_class? target.define_attribute_methods end end end end end