i_wonder 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,10 @@
1
1
  module IWonder
2
2
  class AbTestsController < ApplicationController
3
3
  layout "i_wonder"
4
+
5
+ if defined?(newrelic_ignore)
6
+ newrelic_ignore
7
+ end
4
8
 
5
9
  def index
6
10
  @ab_tests = AbTest.all
@@ -2,6 +2,10 @@ module IWonder
2
2
  class DashboardController < ApplicationController
3
3
  layout "i_wonder"
4
4
 
5
+ if defined?(newrelic_ignore)
6
+ newrelic_ignore
7
+ end
8
+
5
9
  def landing
6
10
  end
7
11
 
@@ -2,6 +2,10 @@ module IWonder
2
2
  class EventsController < ApplicationController
3
3
  layout "i_wonder"
4
4
 
5
+ if defined?(newrelic_ignore)
6
+ newrelic_ignore
7
+ end
8
+
5
9
  def index
6
10
  @groups = Event.groups
7
11
  end
@@ -1,6 +1,10 @@
1
1
  module IWonder
2
2
  class MetricsController < ApplicationController
3
3
  layout "i_wonder"
4
+
5
+ if defined?(newrelic_ignore)
6
+ newrelic_ignore
7
+ end
4
8
 
5
9
  def index
6
10
  @metrics = Metric.all
@@ -2,6 +2,10 @@ module IWonder
2
2
  class ReportsController < ApplicationController
3
3
  layout "i_wonder"
4
4
 
5
+ if defined?(newrelic_ignore)
6
+ newrelic_ignore
7
+ end
8
+
5
9
  def index
6
10
  @reports = Report.all
7
11
  end
@@ -1,6 +1,7 @@
1
1
  module IWonder
2
2
  class AbTest < ActiveRecord::Base
3
3
  attr_accessible :name, :sym, :description, :ab_test_goals_attributes, :test_applies_to, :test_group_names, :options, :test_group_data
4
+ attr_writer :skip_file_save
4
5
  serialize :options, Hash
5
6
  serialize :test_group_data, Hash
6
7
 
@@ -55,8 +56,10 @@ module IWonder
55
56
  end
56
57
 
57
58
  after_save :save_to_file
58
- def save_to_file
59
- AbTesting::Loader.save_ab_test(self)
59
+ def save_to_file
60
+ unless @skip_file_save
61
+ AbTesting::Loader.save_ab_test(self)
62
+ end
60
63
  end
61
64
 
62
65
  after_destroy :remove_file
@@ -39,7 +39,11 @@ module IWonder
39
39
  pre_value = keys.collect{ "?" }.join(", ")
40
40
  values_array = keys.collect{|k|
41
41
  v = attr_hash[k]
42
- v = v.delete_blank.to_yaml if v.is_a?(Hash)
42
+ if v.is_a?(Hash)
43
+ v = v.delete_blank.to_yaml
44
+ elsif v.is_a?(String)
45
+ v = v.truncate(200)
46
+ end
43
47
  v
44
48
  }
45
49
  value_str = sanitize_sql_array( [pre_value] + values_array)
@@ -33,7 +33,7 @@ module IWonder
33
33
  ab_test ||= AbTest.new
34
34
 
35
35
  ab_test.from_xml(file.read)
36
-
36
+ ab_test.skip_file_save = true
37
37
  ab_test.save!
38
38
  end
39
39
  end
@@ -1,3 +1,3 @@
1
1
  module IWonder
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end