Module: SharedBehaviour::Named
- Included in:
- ApiApplication, AssetGroup, AssetShape, BaitLibrary, BaitLibraryType, FacultySponsor, FlowcellType, Insdc::Country, Labware, LibraryType, Pipeline, PrimerPanel, Project, Purpose, ReferenceGenome, RequestType, Sample, Study, Supplier, TagGroup
- Defined in:
- app/models/shared_behaviour/named.rb
Class Method Summary collapse
Class Method Details
.included(base) ⇒ Object
3 4 5 6 7 8 9 |
# File 'app/models/shared_behaviour/named.rb', line 3 def self.included(base) base.class_eval do scope :with_name, ->(*names) { where(name: names.flatten) } scope :sorted_by_name, -> { order(:name) } scope :alphabetical, -> { order(:name) } end end |