Sha256: 37000e416141ed0f1d5d5364759df1c36133b55340d5576b8dd220a15e1be796

Contents?: true

Size: 261 Bytes

Versions: 3

Compression:

Stored size: 261 Bytes

Contents

module ActiveRecordNullObject
  module NullObject
  
    def id 
      nil
    end
  
    def nil?
      true
    end
    
    def empty?
      true
    end
  
    def validate
      errors.add_to_base("is a null object and can't be saved")
    end
  
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
westarete-activerecord_null_object-0.1.0 lib/null_object.rb
activerecord_null_object-0.2.0 lib/null_object.rb
activerecord_null_object-0.1.0 lib/null_object.rb