Sha256: 790958c8cad0891f8c08d8086e0cebf2f1095bb02acd31c0c03b3ac0d0c060e1
Contents?: true
Size: 465 Bytes
Versions: 1
Compression:
Stored size: 465 Bytes
Contents
module Souls module Generate class << self ## Generate Model def model class_name: "souls" file_path = "./app/models/#{class_name.singularize}.rb" return "Model already exist! #{file_path}" if File.exist? file_path File.open(file_path, "w") do |f| f.write <<~EOS class #{class_name.camelize} < ActiveRecord::Base end EOS end file_path end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
souls-0.20.1 | lib/souls/generate/model.rb |