Module: HasBrowser::AssociationProxyMethods

Defined in:
lib/has_browser.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(receiver) ⇒ Object



35
36
37
38
39
# File 'lib/has_browser.rb', line 35

def self.included(receiver)
  receiver.class_eval do
    alias_method_chain :method_missing, :has_browser
  end
end

Instance Method Details

#method_missing_with_has_browser(method, *args, &block) ⇒ Object



41
42
43
# File 'lib/has_browser.rb', line 41

def method_missing_with_has_browser(method, *args, &block)
  method == :browse && proxy_reflection.klass.respond_to?(:has_browser_allowed_finders) ? proxy_reflection.klass.browse(self, args.extract_options!) : method_missing_without_has_browser(method, *args, &block)
end