lib/formtastic/inputs/base.rb in formtastic-3.0.0 vs lib/formtastic/inputs/base.rb in formtastic-3.1.0.rc1
- old
+ new
@@ -1,42 +1,42 @@
module Formtastic
module Inputs
module Base
-
+
attr_accessor :builder, :template, :object, :object_name, :method, :options
-
+
def initialize(builder, template, object, object_name, method, options)
@builder = builder
@template = template
@object = object
@object_name = object_name
@method = method
@options = options.dup
end
-
+
# Usefull for deprecating options.
def warn_and_correct_option!(old_option_name, new_option_name)
if options.key?(old_option_name)
- ::ActiveSupport::Deprecation.warn("The :#{old_option_name} option is deprecated in favour of :#{new_option_name} and will be removed from Formtastic in the next version")
+ ::ActiveSupport::Deprecation.warn("The :#{old_option_name} option is deprecated in favour of :#{new_option_name} and will be removed from Formtastic in the next version", caller(6))
options[new_option_name] = options.delete(old_option_name)
end
end
-
+
# Usefull for deprecating options.
def warn_deprecated_option!(old_option_name, instructions)
if options.key?(old_option_name)
- ::ActiveSupport::Deprecation.warn("The :#{old_option_name} option is deprecated in favour of `#{instructions}` and will be removed in the next version")
+ ::ActiveSupport::Deprecation.warn("The :#{old_option_name} option is deprecated in favour of `#{instructions}` and will be removed in the next version", caller(6))
end
end
-
+
# Usefull for raising an error on previously supported option.
def removed_option!(old_option_name)
raise ArgumentError, ":#{old_option_name} is no longer available" if options.key?(old_option_name)
end
-
+
extend ActiveSupport::Autoload
-
+
autoload :DatetimePickerish
autoload :Associations
autoload :Collections
autoload :Choices
autoload :Database
@@ -51,11 +51,11 @@
autoload :Placeholder
autoload :Stringish
autoload :Timeish
autoload :Validations
autoload :Wrapping
-
+
include Html
include Options
include Database
include Errors
include Hints
@@ -63,10 +63,9 @@
include Validations
include Fileish
include Associations
include Labelling
include Wrapping
-
+
end
end
end
-