Sha256: 0703e3af5365fc9793d10f8b34bf0d7fe5013cfc668a13738b4034ec42a1c524

Contents?: true

Size: 840 Bytes

Versions: 16

Compression:

Stored size: 840 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Plans
    module PaperTrail
      class Version < ::PaperTrail::Version
        self.table_name = "versions"

        # Since the test suite has test coverage for this, we want to declare
        # the association when the test suite is running. This makes it pass
        # when DB is not initialized prior to test runs such as when we run on
        # Travis CI Ex. (there won't be a db in `spec/dummy_app/db/`).
        has_many :version_associations,
                 class_name: "Decidim::Plans::PaperTrail::VersionAssociation",
                 dependent: :destroy

        scope(:within_transaction, ->(id) { where transaction_id: id })

        # Track the associations on the plans object
        def track_associations?
          true
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
decidim-plans-0.18.2 app/models/decidim/plans/paper_trail/version.rb
decidim-plans-0.18.1 app/models/decidim/plans/paper_trail/version.rb
decidim-plans-0.18.0 app/models/decidim/plans/paper_trail/version.rb
decidim-plans-0.17.0 app/models/decidim/plans/paper_trail/version.rb
decidim-plans-0.16.9 app/models/decidim/plans/paper_trail/version.rb
decidim-plans-0.16.8 app/models/decidim/plans/paper_trail/version.rb
decidim-plans-0.16.7 app/models/decidim/plans/paper_trail/version.rb
decidim-plans-0.16.6 app/models/decidim/plans/paper_trail/version.rb
decidim-plans-0.16.5 app/models/decidim/plans/paper_trail/version.rb
decidim-plans-0.16.4 app/models/decidim/plans/paper_trail/version.rb
decidim-plans-0.16.3 app/models/decidim/plans/paper_trail/version.rb
decidim-plans-0.16.2 app/models/decidim/plans/paper_trail/version.rb
decidim-plans-0.16.1 app/models/decidim/plans/paper_trail/version.rb
decidim-plans-0.16.0 app/models/decidim/plans/paper_trail/version.rb
decidim-plans-0.15.1 app/models/decidim/plans/paper_trail/version.rb
decidim-plans-0.15.0 app/models/decidim/plans/paper_trail/version.rb