def basic_message
      assoc = @record.send(@name)
      count = assoc.respond_to?(:count) ? assoc.count : (assoc ? 1 : 0)
      name = I18n.t(@name.to_s.singularize, {
        :scope => [:activerecord, :models],
        :count => count,
        :default => count == 1 ? @name.to_s.gsub('_', ' ') : @name.to_s.gsub('_', ' ').pluralize
      }).downcase

      if count == 1
        I18n.t('dependent_restrict.basic_message.one', :name => name, :default => "Cannot delete record because dependent #{name} exists")
      else
        I18n.t('dependent_restrict.basic_message.others', :count => count, :name => name, :default => "Cannot delete record because #{count} dependent #{name.pluralize} exist")
      end
    end
def basic_message
      assoc = @record.send(@name)
      count = assoc.respond_to?(:count) ? assoc.count : (assoc ? 1 : 0)
      name = I18n.t(@name.to_s.singularize, {
        :scope => [:activerecord, :models],
        :count => count,
        :default => count == 1 ? @name.to_s.gsub('_', ' ') : @name.to_s.gsub('_', ' ').pluralize
      }).downcase

      if count == 1
        I18n.t('dependent_restrict.basic_message.one', :name => name, :default => "Cannot delete record because dependent #{name} exists")
      else
        I18n.t('dependent_restrict.basic_message.others', :count => count, :name => name, :default => "Cannot delete record because #{count} dependent #{name.pluralize} exist")
      end
    end
:nodoc: