Class: ProjectSource

Inherits:
ApplicationRecord show all
Includes:
Housekeeping, Shared::IsData
Defined in:
app/models/project_source.rb

Overview

A ProjectSource links sources to projects.

Instance Attribute Summary (collapse)

Method Summary

Methods included from Housekeeping

#has_polymorphic_relationship?

Methods included from ActiverecordUtilities

#trim_attributes

Instance Attribute Details

- (Integer) project_id

the project

Returns:

  • (Integer)


11
12
13
14
15
16
17
18
19
20
21
# File 'app/models/project_source.rb', line 11

class ProjectSource < ApplicationRecord
  include Housekeeping
  include Shared::IsData

  belongs_to :project, inverse_of: :project_sources
  belongs_to :source, inverse_of: :project_sources

  # source presence validation is handled in PG, as per accepts_nested_attributes constraints

  validates_uniqueness_of :source_id, scope: [:project_id]
end

- (Integer) source_id

Returns the source

Returns:

  • (Integer)

    the source



11
12
13
14
15
16
17
18
19
20
21
# File 'app/models/project_source.rb', line 11

class ProjectSource < ApplicationRecord
  include Housekeeping
  include Shared::IsData

  belongs_to :project, inverse_of: :project_sources
  belongs_to :source, inverse_of: :project_sources

  # source presence validation is handled in PG, as per accepts_nested_attributes constraints

  validates_uniqueness_of :source_id, scope: [:project_id]
end