File tree Expand file tree Collapse file tree 4 files changed +18
-4
lines changed
Expand file tree Collapse file tree 4 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -4,13 +4,14 @@ module BetterTogether
44 # A gathering
55 class Community < ApplicationRecord
66 include Contactable
7- include Host
7+ include HostsEvents
88 include Identifier
99 include Infrastructure ::BuildingConnections
1010 include Joinable
11+ include Permissible
12+ include PlatformHost
1113 include Protected
1214 include Privacy
13- include Permissible
1415 include Metrics ::Viewable
1516
1617 belongs_to :creator ,
Original file line number Diff line number Diff line change 55module BetterTogether
66 # Represents the host application and it's peers
77 class Platform < ApplicationRecord
8- include Host
8+ include PlatformHost
99 include Identifier
1010 include Joinable
1111 include Permissible
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ module BetterTogether
4+ # Concern that when included gives the model access to events through event_host records
5+ module HostsEvents
6+ extend ActiveSupport ::Concern
7+
8+ included do
9+ has_many :event_hosts , as : :host
10+ has_many :hosted_events , through : :event_hosts , source : :event
11+ end
12+ end
13+ end
Original file line number Diff line number Diff line change 22
33module BetterTogether
44 # Concern that when included allows model to be set as host
5- module Host
5+ module PlatformHost
66 extend ActiveSupport ::Concern
77
88 included do
You can’t perform that action at this time.
0 commit comments