Class: Confidence

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

Overview

A Confidence is an annotation that links a user-defined confidence level to a data object. It is an assertion as to the quality of that data.

Instance Attribute Summary (collapse)

Method Summary

Methods included from Housekeeping

#has_polymorphic_relationship?

Methods included from ActiverecordUtilities

#trim_attributes

Instance Attribute Details

- (Integer) confidence_level_id

Returns the controlled vocabulary term used in the confidence

Returns:

  • (Integer)

    the controlled vocabulary term used in the confidence



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'app/models/confidence.rb', line 24

class Confidence < ApplicationRecord

  include Housekeeping
  include Shared::IsData

  acts_as_list scope: [:confidence_level_id]

  belongs_to :confidence_level
  belongs_to :confidence_object, polymorphic: true

  belongs_to :controlled_vocabulary_term, foreign_key: :confidence_level_id

  validates :confidence_level, presence: true

  validates_uniqueness_of :confidence_level_id, scope: [:confidence_object_id, :confidence_object_type]

end

- (Integer) confidence_object_id

Returns Rails polymorphic. The id of of the object being annotated.

Returns:

  • (Integer)

    Rails polymorphic. The id of of the object being annotated.



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'app/models/confidence.rb', line 24

class Confidence < ApplicationRecord

  include Housekeeping
  include Shared::IsData

  acts_as_list scope: [:confidence_level_id]

  belongs_to :confidence_level
  belongs_to :confidence_object, polymorphic: true

  belongs_to :controlled_vocabulary_term, foreign_key: :confidence_level_id

  validates :confidence_level, presence: true

  validates_uniqueness_of :confidence_level_id, scope: [:confidence_object_id, :confidence_object_type]

end

- (String) confidence_object_type

Returns Rails polymorphic. The type of the object being annotated.

Returns:

  • (String)

    Rails polymorphic. The type of the object being annotated.



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'app/models/confidence.rb', line 24

class Confidence < ApplicationRecord

  include Housekeeping
  include Shared::IsData

  acts_as_list scope: [:confidence_level_id]

  belongs_to :confidence_level
  belongs_to :confidence_object, polymorphic: true

  belongs_to :controlled_vocabulary_term, foreign_key: :confidence_level_id

  validates :confidence_level, presence: true

  validates_uniqueness_of :confidence_level_id, scope: [:confidence_object_id, :confidence_object_type]

end

- (Integer) position

Returns a user definable sort code on the tags on an object, handled by acts_as_list

Returns:

  • (Integer)

    a user definable sort code on the tags on an object, handled by acts_as_list



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'app/models/confidence.rb', line 24

class Confidence < ApplicationRecord

  include Housekeeping
  include Shared::IsData

  acts_as_list scope: [:confidence_level_id]

  belongs_to :confidence_level
  belongs_to :confidence_object, polymorphic: true

  belongs_to :controlled_vocabulary_term, foreign_key: :confidence_level_id

  validates :confidence_level, presence: true

  validates_uniqueness_of :confidence_level_id, scope: [:confidence_object_id, :confidence_object_type]

end

- (Integer) project_id

the project ID

Returns:

  • (Integer)


24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'app/models/confidence.rb', line 24

class Confidence < ApplicationRecord

  include Housekeeping
  include Shared::IsData

  acts_as_list scope: [:confidence_level_id]

  belongs_to :confidence_level
  belongs_to :confidence_object, polymorphic: true

  belongs_to :controlled_vocabulary_term, foreign_key: :confidence_level_id

  validates :confidence_level, presence: true

  validates_uniqueness_of :confidence_level_id, scope: [:confidence_object_id, :confidence_object_type]

end