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

Version Path
infopark_rails_connector-6.8.0.beta.200.785.05d4af9 lib/tasks/check.rake
infopark_rails_connector-6.8.0.beta.200.744.99f67fc lib/tasks/check.rake
infopark_rails_connector-6.8.0.beta.200.720.44fbabd lib/tasks/check.rake
infopark_rails_connector-6.8.0.beta.200.713.e5c3150 lib/tasks/check.rake
infopark_rails_connector-6.8.0.beta.200.681.7c84f4a lib/tasks/check.rake
infopark_rails_connector-6.8.0.beta.200.663.ceecdee lib/tasks/check.rake
infopark_rails_connector-6.8.0.beta.200.650.7c93155 lib/tasks/check.rake
infopark_rails_connector-6.8.0.beta.200.621.4c8e1b0 lib/tasks/check.rake