demarches-normaliennes/app/models/champs/repetition_champ.rb
2018-12-19 15:31:11 +01:00

13 lines
354 B
Ruby
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

class Champs::RepetitionChamp < Champ
has_many :champs, -> { ordered }, foreign_key: :parent_id, dependent: :destroy
accepts_nested_attributes_for :champs, allow_destroy: true
def rows
champs.group_by(&:row).values
end
def search_terms
# The user cannot enter any information here so it doesnt make much sense to search
end
end