Files
growstuff/app/models/scientific_name.rb
Daniel O'Connor cb65c42d08 Revert "Brakeman"
This reverts commit df95ba0222.
2022-11-06 17:36:49 +10:30

15 lines
328 B
Ruby

# frozen_string_literal: true
class ScientificName < ApplicationRecord
belongs_to :crop
belongs_to :creator, class_name: 'Member', inverse_of: :created_scientific_names
validates :name, presence: true
validates :crop, presence: true
after_commit :reindex
delegate :reindex, to: :crop
def to_s
name
end
end