Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[rails4] Clean up deprecation notices from simple_form
Browse files Browse the repository at this point in the history
These methods now accept a `wrappers_options` argument.

heartcombo/simple_form#997
jhanggi committed May 24, 2016

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent ea1ab57 commit e89ccb1
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/inputs/currency_input.rb
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ class CurrencyInput < SimpleForm::Inputs::Base

include ActionView::Helpers::NumberHelper

def input
def input(wrapper_options)
set_value

out = template.content_tag :div, class: ["input-prepend", "currency-input"] do
4 changes: 2 additions & 2 deletions app/inputs/order_detail_quantity_input.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
class OrderDetailQuantityInput < SimpleForm::Inputs::FileInput

def input
def input(wrapper_options)
input_html_options[:class] << "timeinput" if object.quantity_as_time?
@builder.text_field(attribute_name, input_html_options).html_safe
end

def hint
def hint(wrapper_options = nil)
if object.scaling_type && !object.quantity_editable?
@hint ||= I18n.t("product_accessories.type.#{object.scaling_type}")
end
2 changes: 1 addition & 1 deletion app/inputs/readonly_input.rb
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ class ReadonlyInput < SimpleForm::Inputs::Base

disable :required

def input
def input(wrapper_options)
classes = [*input_html_options[:class]]
template.content_tag :div, class: classes do
value = input_html_options[:value] || object.send(attribute_name)
4 changes: 2 additions & 2 deletions app/inputs/transaction_chosen_input.rb
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ class TransactionChosenInput < SimpleForm::Inputs::Base # CollectionSelectInput

disable :required

def input
def input(wrapper_options)
options[:label_method] ||= :name
options[:value_method] ||= :id

@@ -23,7 +23,7 @@ def input
template.select_tag(attribute_name, option_data, select_options).html_safe
end

def label
def label(wrapper_options)
options[:label] ||= model_label
super
end

0 comments on commit e89ccb1

Please sign in to comment.