mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-26 10:45:04 -04:00
15 lines
328 B
Ruby
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
|