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.480.261594408 lib/tasks/check.rake
infopark_rails_connector-6.8.0.444.171626367 lib/tasks/check.rake
infopark_rails_connector-6.8.0.406.131718077 lib/tasks/check.rake
infopark_rails_connector-6.8.0.356.19698103 lib/tasks/check.rake
infopark_rails_connector-6.8.0.348.160665197 lib/tasks/check.rake
infopark_rails_connector-6.8.0.328.4a753fc lib/tasks/check.rake
infopark_rails_connector-6.8.0.322.c003f11 lib/tasks/check.rake
infopark_rails_connector-6.8.0.210.ed204b0 lib/tasks/check.rake
infopark_rails_connector-6.8.0.110.6570b45 lib/tasks/check.rake
infopark_rails_connector-6.8.0.72.d18d096 lib/tasks/check.rake
infopark_rails_connector-6.8.0.23.da7f96b lib/tasks/check.rake
infopark_rails_connector-6.8.0.16.def5e85 lib/tasks/check.rake
infopark_rails_connector-6.8.0.15.a24f5ff lib/tasks/check.rake
infopark_rails_connector-6.8.0.beta.200.891.647580e lib/tasks/check.rake
infopark_rails_connector-6.8.0.beta.200.889.d503e42 lib/tasks/check.rake
infopark_rails_connector-6.8.0.beta.200.883.f5f063b lib/tasks/check.rake
infopark_rails_connector-6.8.0.beta.200.884.4bd86e6 lib/tasks/check.rake
infopark_rails_connector-6.8.0.beta.200.869.9609b39 lib/tasks/check.rake
infopark_rails_connector-6.8.0.beta.200.856.8c0fec5 lib/tasks/check.rake
infopark_rails_connector-6.8.0.beta.200.809.bdfa8c3 lib/tasks/check.rake