Module: Communicator::ActiveRecordIntegration::ClassMethods
- Defined in:
- lib/communicator/active_record_integration.rb
Instance Method Summary collapse
-
#receives_from(source, options = {}) ⇒ Object
Class method to register as a communicator receiver.
- #skip_remote_attributes(*attr_names) ⇒ Object
- #skipped_remote_attributes ⇒ Object
Instance Method Details
#receives_from(source, options = {}) ⇒ Object
Class method to register as a communicator receiver
Usage (assuming you expect messages from “post”):
class Post < ActiveRecord::Base
receives_from :post
end
11 12 13 |
# File 'lib/communicator/active_record_integration.rb', line 11 def receives_from(source, ={}) Communicator.register_receiver(self, source, ) end |
#skip_remote_attributes(*attr_names) ⇒ Object
19 20 21 22 23 |
# File 'lib/communicator/active_record_integration.rb', line 19 def skip_remote_attributes(*attr_names) attr_names.each do |attr_name| skipped_remote_attributes << attr_name.to_sym end end |
#skipped_remote_attributes ⇒ Object
15 16 17 |
# File 'lib/communicator/active_record_integration.rb', line 15 def skipped_remote_attributes @skipped_remote_attributes ||= [] end |