Sha256: d2286f096f759118d6578a0ec5e1878e4c57221600e45b4b56a38d121aa4f303

Contents?: true

Size: 733 Bytes

Versions: 7

Compression:

Stored size: 733 Bytes

Contents

module ActiveMocker
  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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
active_mocker-2.1.3 lib/active_mocker/mock/do_nothing_active_record_methods.rb
active_mocker-2.1.2 lib/active_mocker/mock/do_nothing_active_record_methods.rb
active_mocker-2.1.1 lib/active_mocker/mock/do_nothing_active_record_methods.rb
active_mocker-2.1.0 lib/active_mocker/mock/do_nothing_active_record_methods.rb
active_mocker-2.0.0 lib/active_mocker/mock/do_nothing_active_record_methods.rb
active_mocker-2.0.0.rc1 lib/active_mocker/mock/do_nothing_active_record_methods.rb
active_mocker-2.0.0.pre1 lib/active_mocker/mock/do_nothing_active_record_methods.rb