Sha256: 64ec8597a988f0e3b9ba9d6836317bcabb783441ad1908e28bfcb2affab64384

Contents?: true

Size: 780 Bytes

Versions: 20

Compression:

Stored size: 780 Bytes

Contents

# rubocop: disable Style/PredicateName

module Snaptime
  module Relations
    extend ActiveSupport::Concern

    included do
      class_attribute :versioned_associations
      self.versioned_associations = {}.freeze
    end

    module ClassMethods
      def has_one_versioned(name, scope = nil, options = {})
        RelationsBuilder.build_versioned_relation(self, :has_one, name, scope, options)
      end

      def has_many_versioned(name, scope = nil, options = {}, &extension)
        RelationsBuilder.build_versioned_relation(self, :has_many, name, scope, options, &extension)
      end

      def belongs_to_versioned(name, scope = nil, options = {})
        RelationsBuilder.build_versioned_relation(self, :belongs_to, name, scope, options)
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
snaptime-22.0.0 lib/snaptime/relations.rb
snaptime-21.0.0 lib/snaptime/relations.rb
snaptime-0.3.0 lib/snaptime/relations.rb
snaptime-0.2.0 lib/snaptime/relations.rb
snaptime-0.0.20 lib/snaptime/relations.rb
snaptime-0.0.19 lib/snaptime/relations.rb
snaptime-0.0.18 lib/snaptime/relations.rb
snaptime-0.0.17 lib/snaptime/relations.rb
snaptime-0.0.16 lib/snaptime/relations.rb
snaptime-0.0.15 lib/snaptime/relations.rb
snaptime-0.0.14 lib/snaptime/relations.rb
snaptime-0.0.13 lib/snaptime/relations.rb
snaptime-0.0.12 lib/snaptime/relations.rb
snaptime-0.0.11 lib/snaptime/relations.rb
snaptime-0.0.10 lib/snaptime/relations.rb
snaptime-0.0.9 lib/snaptime/relations.rb
snaptime-0.0.8 lib/snaptime/relations.rb
snaptime-0.0.7 lib/snaptime/relations.rb
snaptime-0.0.6 lib/snaptime/relations.rb
snaptime-0.0.1 lib/snaptime/relations.rb