Sha256: 35ce23f297b37802d55f7e055fd76a6acf75d7223bd71e6f995a46fc5f222ae2
Contents?: true
Size: 489 Bytes
Versions: 7
Compression:
Stored size: 489 Bytes
Contents
class Detour::Group < ActiveRecord::Base validates :name, presence: true, uniqueness: { scope: :flaggable_type } validates :flaggable_type, presence: true, inclusion: { in: Detour.config.flaggable_types } has_many :memberships, dependent: :destroy accepts_nested_attributes_for :memberships, allow_destroy: true attr_accessible :name, :flaggable_type, :memberships_attributes def to_s name end def flaggable_class flaggable_type.constantize end end
Version data entries
7 entries across 7 versions & 1 rubygems