Skip to content

Commit

Permalink
deprecated :find_options option
Browse files Browse the repository at this point in the history
  • Loading branch information
justinfrench committed Feb 25, 2012
1 parent b4a7009 commit 586c783
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Expand Up @@ -5,6 +5,7 @@ HEAD
* deprecated :hint_class option (use global configuration)
* deprecated :error_class option (use global configuration)
* deprecated :group_by and :group_label (use :collection option with a HTML string generated by Rails' grouped_options_for_select())
* deprecated :find_options

2.1.0

Expand Down
4 changes: 0 additions & 4 deletions lib/formtastic/helpers/input_helper.rb
Expand Up @@ -146,16 +146,12 @@ module InputHelper
# @option options :multiple [Boolean]
# Specify if the `:select` input should allow multiple selections or not (defaults to `belongs_to` associations, and `true` for `has_many` and `has_and_belongs_to_many` associations)
#
# @option options :find_options [Symbol]
# TODO will probably be deprecated
#
# @option options :include_blank [Boolean]
# Specify if a `:select` input should include a blank option or not (defaults to `include_blank_for_select_by_default` configuration)
#
# @option options :prompt [String]
# Specify the text in the first ('blank') `:select` input `<option>` to prompt a user to make a selection (implicitly sets `:include_blank` to `true`)
#
# @todo Can we deprecate & kill `:find_options`? Should be done with MyModel.some_scope.where(...).order(...).whatever_scope
# @todo Can we deprecate & kill `:label`, `:hint` & `:prompt`? All strings could be shifted to i18n!
#
# @example Accept all default options
Expand Down
1 change: 1 addition & 0 deletions lib/formtastic/inputs/base.rb
Expand Up @@ -17,6 +17,7 @@ def initialize(builder, template, object, object_name, method, options)
warn_deprecated_option!(:error_class, "default_error_class configuration")
warn_deprecated_option!(:group_by, ":collection option with a HTML string generated by Rails' grouped_options_for_select()")
warn_deprecated_option!(:group_label, ":collection option with a HTML string generated by Rails' grouped_options_for_select()")
warn_deprecated_option!(:find_options, "YourModel.find(...)")
end

# Usefull for deprecating options.
Expand Down
6 changes: 4 additions & 2 deletions spec/inputs/select_input_spec.rb
Expand Up @@ -236,8 +236,10 @@
::Author.should_receive(:scoped).with(:conditions => {:active => true})
::Author.should_receive(:where).with({:publisher => true})

semantic_form_for(@new_post) do |builder|
concat(builder.input(:author, :as => :select, :find_options => {:conditions => {:publisher => true}}))
with_deprecation_silenced do
semantic_form_for(@new_post) do |builder|
concat(builder.input(:author, :as => :select, :find_options => {:conditions => {:publisher => true}}))
end
end
end
end
Expand Down

0 comments on commit 586c783

Please sign in to comment.