Class: Dataset

Inherits:
ActiveRecord::Base show all
Defined in:
app/models/dataset.rb

Overview

The saved results of a given search, for analysis

A dataset is the result set from a given search, persisted in the database so that we can run digital humanities analyses on a collection of documents.

Instance Attribute Summary collapse

Method Summary

Methods inherited from ActiveRecord::Base

logger

Instance Attribute Details

#analysis_tasksArray<AnalysisTask>



22
23
24
25
26
27
28
29
30
31
# File 'app/models/dataset.rb', line 22

class Dataset < ActiveRecord::Base
  validates :name, presence: true
  validates :user_id, presence: true

  belongs_to :user
  has_many :entries, class_name: 'DatasetEntry', dependent: :delete_all
  has_many :analysis_tasks, dependent: :destroy

  validates_associated :entries
end

#entriesArray<DatasetEntry>

Returns The documents contained in this dataset (has_many)

Raises:

  • (RecordInvalid)

    if any of the entries are invalid (validates_associated)



22
23
24
25
26
27
28
29
30
31
# File 'app/models/dataset.rb', line 22

class Dataset < ActiveRecord::Base
  validates :name, presence: true
  validates :user_id, presence: true

  belongs_to :user
  has_many :entries, class_name: 'DatasetEntry', dependent: :delete_all
  has_many :analysis_tasks, dependent: :destroy

  validates_associated :entries
end

#nameString

Returns The name of this dataset

Raises:

  • (RecordInvalid)

    if the name is missing (validates :presence)



22
23
24
25
26
27
28
29
30
31
# File 'app/models/dataset.rb', line 22

class Dataset < ActiveRecord::Base
  validates :name, presence: true
  validates :user_id, presence: true

  belongs_to :user
  has_many :entries, class_name: 'DatasetEntry', dependent: :delete_all
  has_many :analysis_tasks, dependent: :destroy

  validates_associated :entries
end

#userUser

Returns The user that owns this dataset

Raises:

  • (RecordInvalid)

    if the user is missing (validates :presence)



22
23
24
25
26
27
28
29
30
31
# File 'app/models/dataset.rb', line 22

class Dataset < ActiveRecord::Base
  validates :name, presence: true
  validates :user_id, presence: true

  belongs_to :user
  has_many :entries, class_name: 'DatasetEntry', dependent: :delete_all
  has_many :analysis_tasks, dependent: :destroy

  validates_associated :entries
end