From c11f35d0e8d9824073496974867a93027b04b4a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sat, 3 Sep 2011 12:17:48 +0200 Subject: [PATCH] Fixes after merge. --- lib/simple_form.rb | 1 - lib/simple_form/has_errors.rb | 13 ------------- lib/simple_form/helpers/has_errors.rb | 1 - test/support/misc_helpers.rb | 4 ++-- 4 files changed, 2 insertions(+), 17 deletions(-) delete mode 100644 lib/simple_form/has_errors.rb diff --git a/lib/simple_form.rb b/lib/simple_form.rb index 3c703933..f7dbd3f8 100644 --- a/lib/simple_form.rb +++ b/lib/simple_form.rb @@ -131,7 +131,6 @@ module SimpleForm components :tag => :div, :class => :input, :error_class => :field_with_errors do |b| b.use :placeholder - b.use :maxlength b.use :label_input b.use :hint, :tag => :span, :class => :hint b.use :error, :tag => :span, :class => :error diff --git a/lib/simple_form/has_errors.rb b/lib/simple_form/has_errors.rb deleted file mode 100644 index 0af0080b..00000000 --- a/lib/simple_form/has_errors.rb +++ /dev/null @@ -1,13 +0,0 @@ -module SimpleForm - module HasErrors - def has_errors? - object && object.respond_to?(:errors) && errors.present? - end - - protected - - def errors - object.errors - end - end -end diff --git a/lib/simple_form/helpers/has_errors.rb b/lib/simple_form/helpers/has_errors.rb index e2e37171..6a21a66f 100644 --- a/lib/simple_form/helpers/has_errors.rb +++ b/lib/simple_form/helpers/has_errors.rb @@ -1,7 +1,6 @@ module SimpleForm module Helpers module HasErrors - private def errors object.errors diff --git a/test/support/misc_helpers.rb b/test/support/misc_helpers.rb index 9962b078..44afe27b 100644 --- a/test/support/misc_helpers.rb +++ b/test/support/misc_helpers.rb @@ -28,11 +28,11 @@ module MiscHelpers # Temporary hack to deal with components. def swap!(*args) swap(*args) do - SimpleForm.deprecated_components = [ :placeholder, :maxlength, :label_input, :hint, :error ] + SimpleForm.deprecated_components = [ :placeholder, :label_input, :hint, :error ] yield end ensure - SimpleForm.deprecated_components = [ :placeholder, :maxlength, :label_input, :hint, :error ] + SimpleForm.deprecated_components = [ :placeholder, :label_input, :hint, :error ] end def with_concat_form_for(object, &block)