lib/formtastic/inputs/base/naming.rb in formtastic-3.1.3 vs lib/formtastic/inputs/base/naming.rb in formtastic-3.1.4
- old
+ new
@@ -2,13 +2,13 @@
module Inputs
module Base
module Naming
def as
- self.class.name.split("::").last.underscore.gsub(/_input$/, '')
+ self.class.name.split("::")[-1].underscore.gsub(/_input$/, '')
end
-
+
def sanitized_object_name
object_name.to_s.gsub(/\]\[|[^-a-zA-Z0-9:.]/, "_").sub(/_$/, "")
end
def sanitized_method_name
@@ -16,11 +16,11 @@
end
def attributized_method_name
method.to_s.gsub(/_id$/, '').to_sym
end
-
+
def humanized_method_name
if builder.label_str_method != :humanize
# Special case where label_str_method should trump the human_attribute_name
# TODO: is this actually a desired bheavior, or should we ditch label_str_method and
# rely purely on :human_attribute_name.
@@ -37,6 +37,6 @@
end
end
end
end
-end
\ No newline at end of file
+end