mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-24 09:43:24 -04:00
8 lines
296 B
Ruby
8 lines
296 B
Ruby
class ScientificName < ApplicationRecord
|
|
after_commit { |sn| sn.crop.__elasticsearch__.index_document if sn.crop && ENV['GROWSTUFF_ELASTICSEARCH'] == "true" }
|
|
belongs_to :crop
|
|
belongs_to :creator, class_name: 'Member'
|
|
validates :name, presence: true
|
|
validates :crop, presence: true
|
|
end
|