Sha256: 0a1122cb0cd50de618d4011da9d97c8d5eaa92e95167891e5b5ad2fade3408bb

Contents?: true

Size: 505 Bytes

Versions: 1

Compression:

Stored size: 505 Bytes

Contents

module AxleAttributes
  module Versioned
    extend ActiveSupport::Concern

    included do
      class_attribute :versioned_attributes, instance_accessor: false
      self.versioned_attributes = Set.new
    end

    module ClassMethods
      def inherited(child)
        child.versioned_attributes = versioned_attributes.dup
        super
      end

      def add_versioned_attribute(*attributes)
        attributes.each { |attribute| versioned_attributes << attribute.to_s }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
axle_attributes-1.13.2 lib/axle_attributes/versioned.rb