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