lib/strongbolt/capability.rb
#
# Checks that the model given as a string exists
#
Checks that the model given as a string exists
Checks that the model given as a string exists
def model_exists?
      if model.present?
        begin
          model.constantize
        rescue NameError => e
          errors.add :model, "#{model} is not a valid model"
        end
      end
    end
def model_exists? if model . present? begin model . constantize rescue NameError => e errors . add :model , "#{model} is not a valid model" end end end
Checks that the model given as a string exists
Checks that the model given as a string exists