Sha256: c70d9eadee3c750cceb7c4bb3a51f40e288c3e843b7da4c17ccd552415647be6

Contents?: true

Size: 516 Bytes

Versions: 7

Compression:

Stored size: 516 Bytes

Contents

module Bodega
  module ApplicationHelper
    def self.included(base)
      base.class_eval do
        alias :method_missing_without_bodega :method_missing
        alias :method_missing :method_missing_with_bodega
      end
    end

    protected
    def method_missing_with_bodega(method_name, *args)
      if method_name.to_s =~ /.+_(url|path)$/ && main_app.respond_to?(method_name)
        return main_app.send(method_name, *args)
      end
      method_missing_without_bodega method_name, *args
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bodega-0.4.12 app/helpers/bodega/application_helper.rb
bodega-0.4.9 app/helpers/bodega/application_helper.rb
bodega-0.4.4 app/helpers/bodega/application_helper.rb
bodega-0.4.3 app/helpers/bodega/application_helper.rb
bodega-0.4.2 app/helpers/bodega/application_helper.rb
bodega-0.4.1 app/helpers/bodega/application_helper.rb
bodega-0.4.0 app/helpers/bodega/application_helper.rb