Module: Communicator::ActiveRecordIntegration::ClassMethods

Defined in:
lib/communicator/active_record_integration.rb

Instance Method Summary collapse

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, options={})
  Communicator.register_receiver(self, source, options)
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_attributesObject



15
16
17
# File 'lib/communicator/active_record_integration.rb', line 15

def skipped_remote_attributes
  @skipped_remote_attributes ||= []
end