Sha256: 56e71c7042d3505ff7e9ddbe6639a68ee093d428cbb4552e9887e07402ce6393

Contents?: true

Size: 649 Bytes

Versions: 14

Compression:

Stored size: 649 Bytes

Contents

# A group is a collection of participants
# in the parent application, a group has a creator
class Group < ActiveRecord::Base
  include ThinkFeelDoDashboard::Concerns::Group

  belongs_to :arm

  has_many :memberships, dependent: :destroy
  has_many :active_memberships,
           -> { active },
           class_name: "Membership",
           foreign_key: :group_id,
           dependent: :destroy,
           inverse_of: :active_group
  has_many :participants, through: :memberships
  has_many :active_participants, through: :active_memberships

  validates :arm_id, presence: true
  validates :title, presence: true, length: { maximum: 50 }
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
think_feel_do_dashboard-1.2.1 spec/dummy/app/models/group.rb
think_feel_do_dashboard-1.2.0.beta1 spec/dummy/app/models/group.rb
think_feel_do_dashboard-1.1.21 spec/dummy/app/models/group.rb
think_feel_do_dashboard-1.1.20 spec/dummy/app/models/group.rb
think_feel_do_dashboard-1.1.19 spec/dummy/app/models/group.rb
think_feel_do_dashboard-1.1.18 spec/dummy/app/models/group.rb
think_feel_do_dashboard-1.1.17 spec/dummy/app/models/group.rb
think_feel_do_dashboard-1.1.16 spec/dummy/app/models/group.rb
think_feel_do_dashboard-1.1.15 spec/dummy/app/models/group.rb
think_feel_do_dashboard-1.1.14 spec/dummy/app/models/group.rb
think_feel_do_dashboard-1.1.13 spec/dummy/app/models/group.rb
think_feel_do_dashboard-1.1.12 spec/dummy/app/models/group.rb
think_feel_do_dashboard-1.1.11 spec/dummy/app/models/group.rb
think_feel_do_dashboard-1.1.10 spec/dummy/app/models/group.rb