Module: Attributable::Association::Target

Included in:
BudgetDivision, DataReleaseStudyType, FacultySponsor, Program, ProjectManager, ReferenceGenome, StudyType
Defined in:
app/models/attributable/association.rb

Defined Under Namespace

Modules: InstanceMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(base) ⇒ Object


4
5
6
7
8
9
# File 'app/models/attributable/association.rb', line 4

def self.extended(base)
  base.class_eval do
    include InstanceMethods
    scope :for_selection, ->() { order(:name) }
  end
end

Instance Method Details

#defaultObject


15
16
17
# File 'app/models/attributable/association.rb', line 15

def default
  nil
end

#for_select_associationObject


11
12
13
# File 'app/models/attributable/association.rb', line 11

def for_select_association
  for_selection.pluck(:name, :id)
end