module Mongoblazer::Document

Public Instance Methods

ar_object() click to toggle source
# File lib/mongoblazer/document.rb, line 15
def ar_object
  @ar_object ||= self.class.name.sub(/Blazer$/, '').constantize.find(ar_id)
end
is_mongoblazed?() click to toggle source
# File lib/mongoblazer/document.rb, line 11
def is_mongoblazed?
  true
end
method_missing(method_sym, *arguments, &block) click to toggle source
Calls superclass method
# File lib/mongoblazer/document.rb, line 19
def method_missing(method_sym, *arguments, &block)
  begin
    super
  rescue NoMethodError
    Rails.logger.debug "MONGOBLAZER DEBUG: #{self.class.name} access to unblazed method:
      #{method_sym} with args:
      #{arguments.inspect}
      for record with id: #{id}"
    if ar_object.respond_to? method_sym
      ar_object.send method_sym
    end
  end
end