Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

use class_attribute instead of class_inheritable_accessor if defined

  • Loading branch information...
commit 3fb94d1dceb95909853ec7972b94b3b17be8ce64 1 parent 65e7e2d
@justinfrench authored
Showing with 14 additions and 5 deletions.
  1. +14 −5 lib/formtastic.rb
View
19 lib/formtastic.rb
@@ -6,11 +6,20 @@
module Formtastic #:nodoc:
class SemanticFormBuilder < ActionView::Helpers::FormBuilder
- class_inheritable_accessor :default_text_field_size, :default_text_area_height, :default_text_area_width, :all_fields_required_by_default, :include_blank_for_select_by_default,
- :required_string, :optional_string, :inline_errors, :label_str_method, :collection_value_methods, :collection_label_methods, :file_metadata_suffixes,
- :inline_order, :custom_inline_order, :file_methods, :priority_countries, :i18n_lookups_by_default, :escape_html_entities_in_hints_and_labels,
- :default_commit_button_accesskey, :default_inline_error_class, :default_hint_class, :default_error_list_class, :instance_reader => false
-
+
+ configurables = [
+ :default_text_field_size, :default_text_area_height, :default_text_area_width, :all_fields_required_by_default, :include_blank_for_select_by_default,
+ :required_string, :optional_string, :inline_errors, :label_str_method, :collection_value_methods, :collection_label_methods, :file_metadata_suffixes,
+ :inline_order, :custom_inline_order, :file_methods, :priority_countries, :i18n_lookups_by_default, :escape_html_entities_in_hints_and_labels,
+ :default_commit_button_accesskey, :default_inline_error_class, :default_hint_class, :default_error_list_class
+ ]
+
+ if defined?(:class_inheritable_attribute)
+ class_inheritable_accessor *configurables
+ else
+ class_attribute *configurables
+ end
+
cattr_accessor :custom_namespace
self.default_text_field_size = nil
Please sign in to comment.
Something went wrong with that request. Please try again.