Module: Chats::Macros
- Defined in:
- lib/chats/macros.rb
Overview
The two host-facing macros. The engine extends ‘ActiveRecord::Base` with this module (via `ActiveSupport.on_load(:active_record)`), so any model can declare:
class User < ApplicationRecord
# can converse: inbox, DMs, groups
end
class Ride < ApplicationRecord
acts_as_chat_subject # conversations can be *about* a ride
end
Each macro just includes the corresponding concern — all the behavior lives in Chats::Messager / Chats::ChatSubject so it’s discoverable, testable, and ‘include`-able directly when a host prefers that style.
Instance Method Summary collapse
Instance Method Details
#acts_as_chat_subject ⇒ Object
24 25 26 |
# File 'lib/chats/macros.rb', line 24 def acts_as_chat_subject include Chats::ChatSubject end |