Skip to content

Commit

Permalink
Merge pull request #9 from Springest/fix-bug-in-setting-funnel
Browse files Browse the repository at this point in the history
Fix bug where funnel could not be set because hash doesn't exist
  • Loading branch information
timflapper committed Aug 11, 2015
2 parents eb0c38c + 7800f4c commit 201cfdf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ab_panel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ def set_env(key, value)
end

def funnels
env['funnels'] ||= Set.new
env[:funnels] ||= Set.new
end

def funnels=(funnels)
Thread.current['ab_panel_env']['funnels'] = funnels
env[:funnels] = funnels
end

def add_funnel(funnel)
Expand Down
4 changes: 4 additions & 0 deletions spec/ab_panel_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@
end

describe ".funnels" do
before do
AbPanel.reset!
end

after do
AbPanel.funnels = nil
end
Expand Down

0 comments on commit 201cfdf

Please sign in to comment.