Module: Mongoid

Defined in:
lib/mongoid_rails_fixtures/mongoid_ext/fixtures.rb,
lib/mongoid_rails_fixtures/mongoid_ext/fixtures.rb,
lib/mongoid_rails_fixtures/mongoid_ext/test_case.rb,
lib/mongoid_rails_fixtures/mongoid_ext/mongoid_ext.rb,
lib/mongoid_rails_fixtures/mongoid_ext/timestamps_ext.rb

Overview

:nodoc:

Defined Under Namespace

Modules: TestFixtures, Timestamps Classes: Config, TestCase

Class Method Summary collapse

Class Method Details

.insert_fixture(fixture, table_name) ⇒ Object

originally in AR/database_statements Inserts the given fixture into the table. Overridden in adapters that require something beyond a simple insert (eg. Oracle).



16
17
18
19
# File 'lib/mongoid_rails_fixtures/mongoid_ext/mongoid_ext.rb', line 16

def self.insert_fixture(fixture, table_name)
  klass = table_name.singularize.capitalize.constantize
  klass.create fixture.instance_variable_get(:@fixture)
end

.silenceObject

Silence deprecation warnings within the block.



5
6
7
8
9
10
# File 'lib/mongoid_rails_fixtures/mongoid_ext/fixtures.rb', line 5

def silence
  old_silenced, @silenced = @silenced, true
  yield
ensure
  @silenced = old_silenced
end