Class: BiologicalAssociationsGraph

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

Overview

A biological associations graph is a collection of BiologicalAssociations. For example, a citable foodweb.

Instance Attribute Summary (collapse)

Class Method Summary (collapse)

Methods included from Housekeeping

#has_polymorphic_relationship?

Methods included from ActiverecordUtilities

#trim_attributes

Instance Attribute Details

- (String) name

Returns the name of the graph

Returns:

  • (String)

    the name of the graph



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

class BiologicalAssociationsGraph < ApplicationRecord
  include Housekeeping
  include Shared::Citable
  include Shared::IsData

  has_many :biological_associations_biological_associations_graphs, inverse_of: :biological_associations_graph
  has_many :biological_associations, through: :biological_associations_biological_associations_graphs

  def self.find_for_autocomplete(params)
    Queries::BiologicalAssociationsGraphAutocompleteQuery.new(params[:term]).all.where(project_id: params[:project_id])
  end

end

- (Integer) project_id

the project ID

Returns:

  • (Integer)


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

class BiologicalAssociationsGraph < ApplicationRecord
  include Housekeeping
  include Shared::Citable
  include Shared::IsData

  has_many :biological_associations_biological_associations_graphs, inverse_of: :biological_associations_graph
  has_many :biological_associations, through: :biological_associations_biological_associations_graphs

  def self.find_for_autocomplete(params)
    Queries::BiologicalAssociationsGraphAutocompleteQuery.new(params[:term]).all.where(project_id: params[:project_id])
  end

end

Class Method Details

+ (Object) find_for_autocomplete(params)



19
20
21
# File 'app/models/biological_associations_graph.rb', line 19

def self.find_for_autocomplete(params)
  Queries::BiologicalAssociationsGraphAutocompleteQuery.new(params[:term]).all.where(project_id: params[:project_id])
end