Module: Saasable::Railties::Helpers::ClassMethods

Defined in:
lib/saasable/railties/helpers.rb

Instance Method Summary collapse

Instance Method Details

#saas_not_found_redirect_to(path_or_url) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# File 'lib/saasable/railties/helpers.rb', line 20

def saas_not_found_redirect_to path_or_url
  self.class_eval <<-METHOD, __FILE__, __LINE__ + 1
    private
      def _redirect_if_saas_not_found
        unless current_saas
          redirect_to "#{path_or_url}"
        end
      end
  METHOD
end

#skip_saasable(options) ⇒ Object



31
32
33
34
# File 'lib/saasable/railties/helpers.rb', line 31

def skip_saasable options
  skip_before_filter :_redirect_if_saas_not_found, options
  before_filter :_skip_saasable, options
end