Sha256: a8a90eef158591dcb08c8f6967575631b4d440b274e0cdcd59dba606d792a0ed

Contents?: true

Size: 704 Bytes

Versions: 9

Compression:

Stored size: 704 Bytes

Contents

# frozen_string_literal: true

module WorksCited
  module Mixins
    # HasWorksCited Mixin
    module HasWorksCited
      extend ActiveSupport::Concern

      # rubocop:disable Naming/PredicateName
      def has_works_cited(_options = {})
        extend ClassMethods
        include InstanceMethods

        has_many :works_cited_citations, as: :record, class_name: 'WorksCited::Citation'
        accepts_nested_attributes_for :works_cited_citations, allow_destroy: true
      end
      # rubocop:enable Naming/PredicateName

      # Extended by has_works_cited mixin
      module ClassMethods
      end

      # Included by has_works_cited mixin
      module InstanceMethods
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
works_cited-0.1.14 lib/works_cited/mixins/has_works_cited.rb
works_cited-0.1.13 lib/works_cited/mixins/has_works_cited.rb
works_cited-0.1.11 lib/works_cited/mixins/has_works_cited.rb
works_cited-0.1.10 lib/works_cited/mixins/has_works_cited.rb
works_cited-0.1.9 lib/works_cited/mixins/has_works_cited.rb
works_cited-0.1.8 lib/works_cited/mixins/has_works_cited.rb
works_cited-0.1.7 lib/works_cited/mixins/has_works_cited.rb
works_cited-0.1.6 lib/works_cited/mixins/has_works_cited.rb
works_cited-0.1.5 lib/works_cited/mixins/has_works_cited.rb