Module: MessageTrain::Mixin
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/message_train/mixin.rb
Overview
Mixin module automatically extended by ActiveRecord::Base
Instance Method Summary collapse
-
#message_train(options = {}) ⇒ Object
Run message_train mixin in your model to enable.
Instance Method Details
#message_train(options = {}) ⇒ Object
Run message_train mixin in your model to enable
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/message_train/mixin.rb', line 7 def ( = {}) cattr_accessor :message_train_table_sym, :message_train_relationships table_sym = table_name.to_sym relationships = [.delete(:only) || [:sender, :recipient]].flatten relationships -= [.delete(:except) || []].flatten associations_from_relationships(relationships) MessageTrain.configure_table(table_sym, name, ) self. = relationships self. = table_sym extend MessageTrain::ClassMethods include MessageTrain::InstanceMethods end |