lib/ransack/helpers/form_builder.rb in ransack-3.2.1 vs lib/ransack/helpers/form_builder.rb in ransack-4.0.0
- old
+ new
@@ -31,11 +31,11 @@
def label(method, *args, &block)
options = args.extract_options!
text = args.first
i18n = options[:i18n] || {}
text ||= object.translate(
- method, i18n.reverse_merge(:include_associations => true)
+ method, i18n.reverse_merge(include_associations: true)
) if object.respond_to? :translate
super(method, text, options, &block)
end
def submit(value = nil, options = {})
@@ -238,11 +238,11 @@
end
def get_attribute_element(action, base)
begin
[
- Translate.association(base, :context => object.context),
+ Translate.association(base, context: object.context),
collection_for_base(action, base)
]
rescue UntraversableAssociationError
nil
end
@@ -251,10 +251,10 @@
def attribute_collection_for_base(attributes, base = nil)
attributes.map do |c|
[
attr_from_base_and_column(base, c),
Translate.attribute(
- attr_from_base_and_column(base, c), :context => object.context
+ attr_from_base_and_column(base, c), context: object.context
)
]
end
end