Sha256: 79d2108c820e8ccd9730b9836d773307f0194d3b62fecdefb7c5d530f163387d

Contents?: true

Size: 778 Bytes

Versions: 21

Compression:

Stored size: 778 Bytes

Contents

require 'virtus'
if Virtus::Attribute::NullifyBlank.method_defined?(:coerce)
  require 'virtus/attribute/nullify_blank'
else
  raise """
  WARNING: The above monkey patch can't be applied as expected.
  See discussion here: https://github.com/dashofcode/tracker_api/commit/27599e7e2169776c32bbff8c972a31b930452879
  """
end
require 'virtus/dirty_attribute'

module TrackerApi
  module Resources
    module Shared
      module Base
        def self.included(base)
          base.class_eval do
            include Virtus.model(nullify_blank: true)
            include Virtus::DirtyAttribute
            include Virtus::DirtyAttribute::InitiallyClean

            include Equalizer.new(:id)

            attribute :id, Integer
          end
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
tracker_api-1.16.0 lib/tracker_api/resources/shared/base.rb
tracker_api-1.15.0 lib/tracker_api/resources/shared/base.rb
tracker_api-1.14.0 lib/tracker_api/resources/shared/base.rb
tracker_api-1.13.0 lib/tracker_api/resources/shared/base.rb
tracker_api-1.12.0 lib/tracker_api/resources/shared/base.rb
tracker_api-1.11.0 lib/tracker_api/resources/shared/base.rb
tracker_api-1.10.0 lib/tracker_api/resources/shared/base.rb
tracker_api-1.9.1 lib/tracker_api/resources/shared/base.rb
tracker_api-1.9.0 lib/tracker_api/resources/shared/base.rb
tracker_api-1.8.0 lib/tracker_api/resources/shared/base.rb
tracker_api-1.7.1 lib/tracker_api/resources/shared/base.rb
tracker_api-1.7.0 lib/tracker_api/resources/shared/base.rb
tracker_api-1.6.0 lib/tracker_api/resources/shared/base.rb
tracker_api-1.5.0 lib/tracker_api/resources/shared/base.rb
tracker_api-1.4.1 lib/tracker_api/resources/shared/base.rb
tracker_api-1.4.0 lib/tracker_api/resources/shared/base.rb
tracker_api-1.3.0 lib/tracker_api/resources/shared/base.rb
tracker_api-1.2.1 lib/tracker_api/resources/shared/base.rb
tracker_api-1.1.1 lib/tracker_api/resources/shared/base.rb
tracker_api-1.1.0 lib/tracker_api/resources/shared/base.rb