Sha256: 98342416e07a37b132027ac23ea6db2a2b6d80fcc19f67d0c8262bd34ad9bc5c
Contents?: true
Size: 693 Bytes
Versions: 48
Compression:
Stored size: 693 Bytes
Contents
namespace :db do namespace :cms do desc "Checks if the infopark CMS object classes are valid ruby class names" task :check_obj_classes => :environment do all_obj_classes = Obj.select("distinct(obj_class)").collect(&:obj_class) invalid_names = all_obj_classes.reject { |obj_class| begin obj_class.constantize rescue NameError => e e.message !~ /not a valid constant name/ end } if invalid_names.empty? puts "\nAll object class names are valid Ruby class names." else puts "\nThe following object class names are invalid Ruby class names:" y invalid_names end end end end
Version data entries
48 entries across 48 versions & 1 rubygems