aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/text_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/helpers/text_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/text_helper.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb
index 2040c52a71..f668f09d34 100644
--- a/actionpack/lib/action_view/helpers/text_helper.rb
+++ b/actionpack/lib/action_view/helpers/text_helper.rb
@@ -277,8 +277,7 @@ module ActionView
# the next time it is used.
def reset_cycle(name = "default")
cycle = get_cycle(name)
- return if cycle.nil?
- cycle.reset
+ cycle.reset unless cycle.nil?
end
class Cycle #:nodoc:
@@ -305,12 +304,12 @@ module ActionView
# guaranteed to be reset every time a page is rendered, so it
# uses an instance variable of ActionView::Base.
def get_cycle(name)
- @_cycles = Hash.new if @_cycles.nil?
+ @_cycles = Hash.new unless defined?(@_cycles)
return @_cycles[name]
end
def set_cycle(name, cycle_object)
- @_cycles = Hash.new if @_cycles.nil?
+ @_cycles = Hash.new unless defined?(@_cycles)
@_cycles[name] = cycle_object
end