Sha256: 82b8e29ab76638400d0bbf60ccd844c9c384e786c8d079befc33debeb67c3c88

Contents?: true

Size: 665 Bytes

Versions: 20

Compression:

Stored size: 665 Bytes

Contents

module ActiveMocker
module Mock
module DoNothingActiveRecordMethods

  def self.included(base)
    base.extend(ClassMethods)
  end

  module ClassMethods

    def transaction
      yield
    rescue LocalJumpError => err
      raise err
    rescue StandardError => e
      raise e
    end

    def column_names
      attribute_names
    end

  end

  def readonly?
    false
  end

  def errors
    obj = Object.new

    def obj.[](key)
      []
    end

    def obj.full_messages()
      []
    end

    obj
  end

  def valid?
    true
  end

  def marked_for_destruction?
    false
  end

  def destroyed?
    false
  end

  def reload
    self
  end

end
end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
active_mocker-2.0.0.beta1 lib/active_mocker/mock/do_nothing_active_record_methods.rb
active_mocker-1.8.4 lib/active_mocker/mock/do_nothing_active_record_methods.rb
active_mocker-1.8.3 lib/active_mocker/mock/do_nothing_active_record_methods.rb
active_mocker-1.8.2 lib/active_mocker/mock/do_nothing_active_record_methods.rb
active_mocker-1.8.1 lib/active_mocker/mock/do_nothing_active_record_methods.rb
active_mocker-1.8 lib/active_mocker/mock/do_nothing_active_record_methods.rb
active_mocker-1.7.3 lib/active_mocker/mock/do_nothing_active_record_methods.rb
active_mocker-1.7.2 lib/active_mocker/mock/do_nothing_active_record_methods.rb
active_mocker-1.7.1 lib/active_mocker/mock/do_nothing_active_record_methods.rb
active_mocker-1.7.1rc lib/active_mocker/mock/do_nothing_active_record_methods.rb
active_mocker-1.7 lib/active_mocker/mock/do_nothing_active_record_methods.rb
active_mocker-1.7rc2 lib/active_mocker/mock/do_nothing_active_record_methods.rb
active_mocker-1.7.beta3 lib/active_mocker/mock/do_nothing_active_record_methods.rb
active_mocker-1.7.beta2 lib/active_mocker/mock/do_nothing_active_record_methods.rb
active_mocker-1.6.4 lib/active_mocker/mock/do_nothing_active_record_methods.rb
active_mocker-1.7.beta1 lib/active_mocker/mock/do_nothing_active_record_methods.rb
active_mocker-1.6.3 lib/active_mocker/mock/do_nothing_active_record_methods.rb
active_mocker-1.6.2 lib/active_mocker/mock/do_nothing_active_record_methods.rb
active_mocker-1.6.1 lib/active_mocker/mock/do_nothing_active_record_methods.rb
active_mocker-1.6 lib/active_mocker/mock/do_nothing_active_record_methods.rb