Sha256: 313927a56fdd3c75750d0bf69364280c83c2cb3884a0e029a5fad7f0b1eb7732
Contents?: true
Size: 1.41 KB
Versions: 14
Compression:
Stored size: 1.41 KB
Contents
module Rails3::Assist module BaseHelper def self.included(base) base.extend ClassMethods base.class_eval do include Rails3::Assist::App include ::Thor::Actions end end module ClassMethods def multi_aliases_for name multi_alias :_after_ => name, :create => :new, :insert_into => [:inject_into, :update], :read => :X_content, :remove => :delete end end protected def get_type options = {} case options when Hash raise ArgumentError, "No artifact type specified #{options}" if !options[:type] options[:type].to_sym when String, Symbol options.to_sym else raise ArgumentError, "Bad artifact type specified #{options}" end end def debug? Rails3::Assist.debug_on end def debug msg puts msg if debug? end def set options, type options.merge!(:type => type) options end def orm_notify '' end def marker_option name, options={} type = last_option(options)[:type] marker_content = if type method = :"#{type}_marker" orm_marker = send method, name, options if respond_to? method else name.to_s.camelize end options[:before] ? {:before => marker_content} : {:after => marker_content} end end end
Version data entries
14 entries across 14 versions & 1 rubygems