Sha256: 84ca8b2b29372c91da90506b001a57a556d823bdaecf4fdc630582a84b6056f0
Contents?: true
Size: 550 Bytes
Versions: 13
Compression:
Stored size: 550 Bytes
Contents
module Merit module Generators class MeritGenerator < Rails::Generators::NamedBase source_root File.expand_path('../templates', __FILE__) hook_for :orm def inject_merit_content if model_exists? inject_into_class(model_path, class_name, " has_merit\n\n") end end private def model_exists? File.exist? File.join(destination_root, model_path) end def model_path @model_path ||= File.join('app', 'models', "#{file_path}.rb") end end end end
Version data entries
13 entries across 13 versions & 1 rubygems