Sha256: ef64397d47b5bd09e209f66552877471a4faa1994fed37ee76e58cde61ac35af
Contents?: true
Size: 580 Bytes
Versions: 31
Compression:
Stored size: 580 Bytes
Contents
#class Group < ActiveRecord::Base class Group < Party class_table_inheritance # TODO (uwe): We need to specify :join_table, :foreign_key and :association_foreign_key # even if they follow the defaults since ClassTableInheritanceInRails breaks it. has_and_belongs_to_many :users, :join_table => "groups_users", :foreign_key => "group_id", :association_foreign_key => 'user_id' validates_presence_of :name validates_length_of :name, :allow_nil => false, :maximum => 255 validates_uniqueness_of :name def includes?(user) return users.include?(user) end end
Version data entries
31 entries across 31 versions & 1 rubygems