def method_missing(method_id, *arguments, &block)#:nodoc:

      # If the missing method is  XXX_without_static_rc, define XXX
      # using the superclass ActiveRecord::Base method_missing then
      # Finally, alias chain it to XXX_with_static_rc
      if ((match = method_id.to_s.match(/(.*)_without_static_rc$/)) &&
          (base_method_id = match[1]))
        begin
          return super(base_method_id, *arguments, &block)
        ensure
          define_static_rc_alias(base_method_id)
        end
      end

      # If the missing method is a finder like find_by_name
      # Define on the class then invoke find_by_name_with_static_rc
      if match = ActiveRecord::DynamicFinderMatch.match(method_id)
        attribute_names = match.attribute_names
        if all_attributes_exists?(attribute_names) &&  match.finder?
          attributes = construct_attributes_from_arguments(attribute_names, arguments)
          method_name = define_static_record_finder_method(method_id, match.finder, match.bang?, attributes)
          return self.send method_name, *arguments
        end
      end

      #If nothing matches, invoke the super
      super(method_id, *arguments, &block)
    end
def method_missing(method_id, *arguments, &block)#:nodoc:

      # If the missing method is  XXX_without_static_rc, define XXX
      # using the superclass ActiveRecord::Base method_missing then
      # Finally, alias chain it to XXX_with_static_rc
      if ((match = method_id.to_s.match(/(.*)_without_static_rc$/)) &&
          (base_method_id = match[1]))
        begin
          return super(base_method_id, *arguments, &block)
        ensure
          define_static_rc_alias(base_method_id)
        end
      end

      # If the missing method is a finder like find_by_name
      # Define on the class then invoke find_by_name_with_static_rc
      if match = ActiveRecord::DynamicFinderMatch.match(method_id)
        attribute_names = match.attribute_names
        if all_attributes_exists?(attribute_names) &&  match.finder?
          attributes = construct_attributes_from_arguments(attribute_names, arguments)
          method_name = define_static_record_finder_method(method_id, match.finder, match.bang?, attributes)
          return self.send method_name, *arguments
        end
      end

      #If nothing matches, invoke the super
      super(method_id, *arguments, &block)
    end
def method_missing ( method_id , * arguments , & block ) #:nodoc: # If the missing method is  XXX_without_static_rc, define XXX # using the superclass ActiveRecord::Base method_missing then # Finally, alias chain it to XXX_with_static_rc if ( ( match = method_id . to_s . match ( / / ) ) && ( base_method_id = match [ 1 ] ) ) begin return super ( base_method_id , arguments , block ) ensure define_static_rc_alias ( base_method_id ) end end # If the missing method is a finder like find_by_name # Define on the class then invoke find_by_name_with_static_rc if match = ActiveRecord :: DynamicFinderMatch . match ( method_id ) attribute_names = match . attribute_names if all_attributes_exists? ( attribute_names ) && match . finder? attributes = construct_attributes_from_arguments ( attribute_names , arguments ) method_name = define_static_record_finder_method ( method_id , match . finder , match . bang? , attributes ) return self . send method_name , arguments end end #If nothing matches, invoke the super super ( method_id , arguments , block ) end
Method missing is overridden to use cache calls for finder methods
Method missing is overridden to use cache calls for finder methods