mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-26 10:45:04 -04:00
* I will add the international alternate names for the crops. * Mark required * Update factory * Add placeholder * Fix seeds * Add language, though hardcoded to EN in most places --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>
14 lines
339 B
Ruby
14 lines
339 B
Ruby
# frozen_string_literal: true
|
|
|
|
class AlternateName < ApplicationRecord
|
|
belongs_to :crop
|
|
belongs_to :creator, class_name: 'Member', inverse_of: :created_alternate_names
|
|
validates :name, presence: true
|
|
validates :crop, presence: true
|
|
validates :language, presence: true
|
|
|
|
after_commit :reindex
|
|
|
|
delegate :reindex, to: :crop
|
|
end
|