Sha256: e2bdfb4f4b6652ace35a7c1b0d001ebe4c1b8c4894906f97baa2f5e73b953132

Contents?: true

Size: 892 Bytes

Versions: 1

Compression:

Stored size: 892 Bytes

Contents

module Rails::Assist
  module Controller
    def controller_marker name, options=nil
      "#{name.to_s.camelize}Controller < ActionController::Base"
    end
  end

  module Helper
    def helper_marker name, options=nil
      "#{name.to_s.camelize}Helper"
    end
  end
  
  module Mailer
    def mailer_marker name, options=nil
      "#{name.to_s.camelize} < ActionMailer::Base"
    end
  end    

  module Observer
    def observer_marker name, options=nil
      "#{name.to_s.camelize}Observer < ActiveRecord::Observer"
    end
  end
  
  module Model   
    include Rails::Assist::BaseHelper    
    
    def model_marker name, options={}
      return send :orm_marker_name, options if respond_to?(:orm_marker_name)
      name.camelize      
    end
    
    def orm_notify
      ". You must specify an ORM with the macro use_orm, f.ex -- use_orm :active_record"
    end    
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails3_assist-0.2.2 lib/rails3_assist/artifact/markers.rb