Class: ConcreteIssue

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/concrete_issue.rb

Overview

An expression of an Issue in a particular FindingAidVersion on a particular Run.

Instance Attribute Summary (collapse)

Belongs to (collapse)

Instance Method Summary (collapse)

Instance Attribute Details

- (DateTime) created_at

Returns:

  • (DateTime)


25
# File 'db/schema.rb', line 25

t.datetime "created_at"

- (Text) diagnostic_info

Returns:

  • (Text)


24
# File 'db/schema.rb', line 24

t.text     "diagnostic_info",        default: "", null: false

- (Integer) line_number

Returns:

  • (Integer)


23
# File 'db/schema.rb', line 23

t.integer  "line_number",                         null: false

- (Text) location

Returns:

  • (Text)


22
# File 'db/schema.rb', line 22

t.text     "location",                            null: false

- (DateTime) updated_at

Returns:

  • (DateTime)


26
# File 'db/schema.rb', line 26

t.datetime "updated_at"

Instance Method Details

- (FindingAidVersion) finding_aid_version



5
# File 'app/models/concrete_issue.rb', line 5

belongs_to :finding_aid_version

- (Hash) generate_tags_from_diagnostic_info

Process the raw <diagnostic_info> into a hash suitable for JSON storage

Returns:

  • (Hash)

    tags



12
13
14
15
16
17
18
19
# File 'app/models/concrete_issue.rb', line 12

def generate_tags_from_diagnostic_info
  self.tags = diagnostic_info
              .split("\n")
              .map {|s| s.match(/([^\s:]+): (.+)/)}
              .reject(&:blank?)
              .map {|m| m[1..2]}
              .to_h
end

- (Issue) issue

Returns:

See Also:



4
# File 'app/models/concrete_issue.rb', line 4

belongs_to :issue

- (Run) run

Returns:

See Also:



3
# File 'app/models/concrete_issue.rb', line 3

belongs_to :run