Skip to content

Commit

Permalink
[rails4] Clean up deprecation notices from simple_form (#623)
Browse files Browse the repository at this point in the history
These methods now accept a `wrappers_options` argument.

heartcombo/simple_form#997
  • Loading branch information
jhanggi authored and drench committed May 25, 2016
1 parent c551cbb commit 89fb837
Show file tree
Hide file tree
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
Expand Up @@ -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
Expand Down
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
Expand Down
2 changes: 1 addition & 1 deletion app/inputs/readonly_input.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions app/inputs/transaction_chosen_input.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 89fb837

Please sign in to comment.