module RSpec::Rails::Mocks::ActiveRecordStubExtensions

def as_new_record

def as_new_record
  self.__send__("#{self.class.primary_key}=", nil)
  super
end

def connection

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

def new_record?

def new_record?
  !persisted?
end