Class: Group

Inherits:
ApplicationRecord show all
Defined in:
app/models/group.rb

Overview

This model manage the group

Relations

has many Event has and belongs to many User

Validates

Instance Attribute Summary collapse

Instance Attribute Details

#titleString

Returns group title.

Returns:

  • (String)

    group title



11
12
13
14
15
16
# File 'app/models/group.rb', line 11

class Group < ApplicationRecord
  has_and_belongs_to_many :users
  has_many :events, dependent: :restrict_with_error

  validates :title, presence: true
end