Skip to content

Commit

Permalink
Show currently selected rule first when selected.
Browse files Browse the repository at this point in the history
Re-order list : if there is a list and you have allowed blank, the list should be ordered show the currently_selected_rule first.
(Styling issue)

close #65
  • Loading branch information
ericmwalsh authored and nathany committed Sep 29, 2014
1 parent 6e5184b commit 742908a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ constant (thanks @fourseven)

* [FIX] For blank select fields.
* Testing multiple Rails versions in Travis CI.
* Show currently selected rule first when selected [#65](https://github.com/GetJobber/recurring_select/pull/65) (thanks @ericmwalsh)

# 1.2.0 / 2013-07-03

Expand Down
2 changes: 1 addition & 1 deletion app/helpers/recurring_select_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ def recurring_options_for_select(currently_selected_rule = nil, default_schedule

if default_schedules.blank?
if currently_selected_rule.present?
options_array << blank_option if options[:allow_blank]
options_array << ice_cube_rule_to_option(currently_selected_rule)
options_array << separator
options_array << [I18n.t("recurring_select.change_schedule"), "custom"]
options_array << blank_option if options[:allow_blank]
else
options_array << blank_option
options_array << [I18n.t("recurring_select.set_schedule"), "custom"]
Expand Down

0 comments on commit 742908a

Please sign in to comment.