Sha256: 1bbedfaa7e546844f0c940eec67397f42733c160632005d09dca02b1aa1f4b40
Contents?: true
Size: 489 Bytes
Versions: 4
Compression:
Stored size: 489 Bytes
Contents
# Trait to manage the categories of a conference. # origin: M module Conference::CategoriesTrait as_trait do has_many :conference_categories has_many :categories, :through => :conference_categories does 'list_field', :category_list def category_names categories.collect(&:name) end def read_category_list category_ids.collect(&:to_s) end def write_category_list(ids) self.category_ids = ids.collect(&:to_i) end end end
Version data entries
4 entries across 4 versions & 1 rubygems