Skip to content

Commit

Permalink
use extract_options! in cycle helper
Browse files Browse the repository at this point in the history
  • Loading branch information
lest committed Apr 7, 2012
1 parent bcd2269 commit fd3f550
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions actionpack/lib/action_view/helpers/text_helper.rb
@@ -1,5 +1,6 @@
require 'active_support/core_ext/object/blank'
require 'active_support/core_ext/string/filters'
require 'active_support/core_ext/array/extract_options'

module ActionView
# = Action View Text Helpers
Expand Down Expand Up @@ -306,12 +307,9 @@ def simple_format(text, html_options={}, options={})
# </tr>
# <% end %>
def cycle(first_value, *values)
if (values.last.instance_of? Hash)
params = values.pop
name = params[:name]
else
name = "default"
end
options = values.extract_options!
name = options.fetch(:name, "default")

values.unshift(first_value)

cycle = get_cycle(name)
Expand Down

0 comments on commit fd3f550

Please sign in to comment.