Sha256: 7b7ef78da71204a3079665c39d7bc2103eefba4fa692cb4e54b36c06b962477e
Contents?: true
Size: 821 Bytes
Versions: 16
Compression:
Stored size: 821 Bytes
Contents
module SOULs class Delete < Thor desc "migration [migration_NAME]", "Delete Migration files Template" def migration(class_name) singularized_class_name = class_name.underscore.singularize pluralized_class_name = class_name.underscore.pluralize Dir.chdir(SOULs.get_mother_path.to_s) do file_paths = { model_file_path: "./apps/api/app/models/#{singularized_class_name}.rb", rspec_file_path: "./apps/api/spec/models/#{singularized_class_name}_spec.rb", migration_file_path: Dir["db/migrate/*create_#{pluralized_class_name}.rb"].first } file_paths.each do |_k, v| FileUtils.rm_f(v) SOULs::Painter.delete_file(v) rescue StandardError => e puts(e) end file_paths end end end end
Version data entries
16 entries across 16 versions & 1 rubygems