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

Version Path
backlog-0.2.0 app/models/group.rb
backlog-0.2.1 app/models/group.rb
backlog-0.3.0 app/models/group.rb
backlog-0.3.1 app/models/group.rb
backlog-0.3.3 app/models/group.rb
backlog-0.3.2 app/models/group.rb
backlog-0.3.4 app/models/group.rb
backlog-0.3.5 app/models/group.rb
backlog-0.3.6 app/models/group.rb
backlog-0.3.7 app/models/group.rb
backlog-0.3.8 app/models/group.rb
backlog-0.3.9 app/models/group.rb
backlog-0.5.0 app/models/group.rb
backlog-0.4.0 app/models/group.rb
backlog-0.5.1 app/models/group.rb
backlog-0.5.10 app/models/group.rb
backlog-0.5.2 app/models/group.rb
backlog-0.5.4 app/models/group.rb
backlog-0.5.3 app/models/group.rb
backlog-0.5.5 app/models/group.rb