Permalink
Browse files

deprecated :find_options option

  • Loading branch information...
1 parent b4a7009 commit 586c7834dfef93eca7593556716a614198a98b57 @justinfrench justinfrench committed Feb 25, 2012
Showing with 6 additions and 6 deletions.
  1. +1 −0 CHANGELOG
  2. +0 −4 lib/formtastic/helpers/input_helper.rb
  3. +1 −0 lib/formtastic/inputs/base.rb
  4. +4 −2 spec/inputs/select_input_spec.rb
View
1 CHANGELOG
@@ -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
View
4 lib/formtastic/helpers/input_helper.rb
@@ -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
View
1 lib/formtastic/inputs/base.rb
@@ -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.
View
6 spec/inputs/select_input_spec.rb
@@ -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

0 comments on commit 586c783

Please sign in to comment.