Files
growstuff/app/models/alternate_name.rb
google-labs-jules[bot] ac1463e2cf Add international alternate names for crops (#4132)
* 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>
2025-08-24 21:44:41 +09:30

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