Sha256: 11a1b6c741624aac93f00a3791931661511a61eb8e6b8f32ce470c5ab00001e3

Contents?: true

Size: 403 Bytes

Versions: 5

Compression:

Stored size: 403 Bytes

Contents

module Micronaut
  module Rails
    module Mocking

      module ModelStubber

        def connection
          raise MicronautRails::IllegalDataAccessException.new("stubbed/mocked models are not allowed to access the database")
        end

        def new_record?
          id.nil?
        end

        def as_new_record
          self.id = nil
          self
        end

      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spicycode-micronaut-rails-0.1.7.1 lib/micronaut/rails/mocking/model_stubber.rb
spicycode-micronaut-rails-0.1.8.0 lib/micronaut/rails/mocking/model_stubber.rb
spicycode-micronaut-rails-0.1.8.1 lib/micronaut/rails/mocking/model_stubber.rb
spicycode-micronaut-rails-0.1.9.0 lib/micronaut/rails/mocking/model_stubber.rb
spicycode-micronaut-rails-0.2.0.0 lib/micronaut/rails/mocking/model_stubber.rb