Skip to content
This repository
Browse code

Cleanup trailing whitespace

Trailing whitespace isn't friendly to git or vim users.
  • Loading branch information...
commit 1174647779f8cd7ed3f11fae8d8e78f7dc052e18 1 parent 9db9a8e
Erik Michaels-Ober authored March 06, 2012

Showing 36 changed files with 104 additions and 104 deletions. Show diff stats Hide diff stats

  1. 2  CHANGELOG.rdoc
  2. 2  VERSION
  3. 18  app/controllers/impressionist_controller.rb
  4. 2  app/models/impression.rb
  5. 6  app/models/impressionist/bots.rb
  6. 2  config/routes.rb
  7. 4  lib/generators/impressionist/impressionist_generator.rb
  8. 2  lib/generators/impressionist/templates/create_impressions_table.rb
  9. 2  lib/impressionist/bots.rb
  10. 2  lib/impressionist/engine.rb
  11. 2  test_app/app/controllers/application_controller.rb
  12. 8  test_app/app/controllers/articles_controller.rb
  13. 14  test_app/app/controllers/posts_controller.rb
  14. 10  test_app/app/controllers/widgets_controller.rb
  15. 2  test_app/app/models/dummy.rb
  16. 2  test_app/app/models/user.rb
  17. 2  test_app/app/views/articles/index.html.erb
  18. 2  test_app/app/views/articles/show.html.erb
  19. 4  test_app/config/database.yml
  20. 12  test_app/db/migrate/20111127195013_create_impressions_table.rb
  21. 4  test_app/lib/tasks/cucumber.rake
  22. 2  test_app/public/javascripts/controls.js
  23. 2  test_app/public/javascripts/dragdrop.js
  24. 2  test_app/public/javascripts/effects.js
  25. 10  test_app/spec/controllers/controller_spec.rb
  26. 2  test_app/spec/fixtures/articles.yml
  27. 14  test_app/spec/fixtures/impressions.yml
  28. 2  test_app/spec/fixtures/posts.yml
  29. 2  test_app/spec/fixtures/widgets.yml
  30. 6  test_app/spec/intializers/initializers_spec.rb
  31. 2  test_app/spec/models/counter_caching_spec.rb
  32. 34  test_app/spec/models/model_spec.rb
  33. 4  test_app/spec/rails_generators/rails_generators_spec.rb
  34. 4  test_app/spec/spec_helper.rb
  35. 14  upgrade_migrations/version_0_3_0.rb
  36. 4  upgrade_migrations/version_0_4_0.rb
2  CHANGELOG.rdoc
Source Rendered
@@ -16,4 +16,4 @@
16 16
 * @widget.unique_impression_count now uses request_hash.  This was incorrectly stated in the README, since it was using ip_address.  The README is correct as a result of the method change.
17 17
 
18 18
 == 0.2.4 (2011-02-17)
19  
-* Fix issue #1 - action_name and controller_name were not being logged for impressionist method inside action
  19
+* Fix issue #1 - action_name and controller_name were not being logged for impressionist method inside action
2  VERSION
... ...
@@ -1 +1 @@
1  
-1.0.1
  1
+1.0.1
18  app/controllers/impressionist_controller.rb
@@ -39,22 +39,22 @@ def impressionist_subapp_filter(actions=nil,unique_opts=nil)
39 39
     end
40 40
 
41 41
     private
42  
-    
  42
+
43 43
     def bypass
44 44
       Impressionist::Bots::WILD_CARDS.each do |wild_card|
45 45
         return true if request.user_agent and request.user_agent.downcase.include? wild_card
46 46
       end
47 47
       Impressionist::Bots::LIST.include? request.user_agent
48 48
     end
49  
-    
  49
+
50 50
     def unique_instance?(impressionable, unique_opts)
51 51
       return unique_opts.blank? || !impressionable.impressions.where(unique_query(unique_opts)).exists?
52 52
     end
53  
-    
  53
+
54 54
     def unique?(unique_opts)
55 55
       return unique_opts.blank? || !Impression.where(unique_query(unique_opts)).exists?
56 56
     end
57  
-    
  57
+
58 58
     # creates the query to check for uniqueness
59 59
     def unique_query(unique_opts)
60 60
       full_statement = direct_create_statement
@@ -64,7 +64,7 @@ def unique_query(unique_opts)
64 64
         query
65 65
       end
66 66
     end
67  
-    
  67
+
68 68
     # creates a statment hash that contains default values for creating an impression via an AR relation.
69 69
     def associative_create_statement(query_params={})
70 70
       query_params.reverse_merge!(
@@ -77,7 +77,7 @@ def associative_create_statement(query_params={})
77 77
         :referrer => request.referer
78 78
         )
79 79
     end
80  
-    
  80
+
81 81
     # creates a statment hash that contains default values for creating an impression.
82 82
     def direct_create_statement(query_params={})
83 83
       query_params.reverse_merge!(
@@ -86,7 +86,7 @@ def direct_create_statement(query_params={})
86 86
         )
87 87
       associative_create_statement(query_params)
88 88
     end
89  
-    
  89
+
90 90
     def session_hash
91 91
       # # careful: request.session_options[:id] encoding in rspec test was ASCII-8BIT
92 92
       # # that broke the database query for uniqueness. not sure if this is a testing only issue.
@@ -95,7 +95,7 @@ def session_hash
95 95
       # # request.session_options[:id].encode("ISO-8859-1")
96 96
       request.session_options[:id]
97 97
     end
98  
-    
  98
+
99 99
     #use both @current_user and current_user helper
100 100
     def user_id
101 101
       user_id = @current_user ? @current_user.id : nil rescue nil
@@ -103,4 +103,4 @@ def user_id
103 103
       user_id
104 104
     end
105 105
   end
106  
-end
  106
+end
2  app/models/impression.rb
@@ -13,4 +13,4 @@ def update_impressions_counter_cache
13 13
       resouce.try(:update_counter_cache)
14 14
     end
15 15
   end
16  
-end
  16
+end
6  app/models/impressionist/bots.rb
... ...
@@ -1,8 +1,8 @@
1 1
 module Impressionist
2 2
   module Bots
3 3
     WILD_CARDS = ["bot","yahoo","slurp","google","msn","crawler"]
4  
-    
5  
-    LIST = ["<a href='http://www.unchaos.com/'> UnChaos </a> From Chaos To Order Hybrid Web Search Engine.(vadim_gonchar@unchaos.com)", 
  4
+
  5
+    LIST = ["<a href='http://www.unchaos.com/'> UnChaos </a> From Chaos To Order Hybrid Web Search Engine.(vadim_gonchar@unchaos.com)",
6 6
       "<a href='http://www.unchaos.com/'> UnChaos Bot Hybrid Web Search Engine. </a> (vadim_gonchar@unchaos.com)",
7 7
       "<b> UnChaosBot From Chaos To Order UnChaos Hybrid Web Search Engine at www.unchaos.com </b> (info@unchaos.com)",
8 8
       "<http://www.sygol.com/> http://www.sygol.com",
@@ -1459,4 +1459,4 @@ module Bots
1459 1459
       "zspider/0.9-dev http://feedback.redkolibri.com/",
1460 1460
       "ZyBorg/1.0 (ZyBorg@WISEnut.com; http://www.WISEnut.com)"]
1461 1461
   end
1462  
-end
  1462
+end
2  config/routes.rb
... ...
@@ -1,2 +1,2 @@
1 1
 Rails.application.routes.draw do
2  
-end
  2
+end
4  lib/generators/impressionist/impressionist_generator.rb
... ...
@@ -1,5 +1,5 @@
1 1
 require 'rails/generators'
2  
-require 'rails/generators/migration'     
  2
+require 'rails/generators/migration'
3 3
 
4 4
 class ImpressionistGenerator < Rails::Generators::Base
5 5
   include Rails::Generators::Migration
@@ -17,4 +17,4 @@ def self.next_migration_number(dirname)
17 17
   def create_migration_file
18 18
     migration_template 'create_impressions_table.rb', 'db/migrate/create_impressions_table.rb'
19 19
   end
20  
-end
  20
+end
2  lib/generators/impressionist/templates/create_impressions_table.rb
@@ -34,4 +34,4 @@ def self.down
34 34
 
35 35
     drop_table :impressions
36 36
   end
37  
-end
  37
+end
2  lib/impressionist/bots.rb
@@ -15,4 +15,4 @@ def self.consume
15 15
       list
16 16
     end
17 17
   end
18  
-end
  18
+end
2  lib/impressionist/engine.rb
@@ -14,4 +14,4 @@ class Engine < Rails::Engine
14 14
       end
15 15
     end
16 16
   end
17  
-end
  17
+end
2  test_app/app/controllers/application_controller.rb
... ...
@@ -1,7 +1,7 @@
1 1
 class ApplicationController < ActionController::Base
2 2
   protect_from_forgery
3 3
   before_filter :secondary_before_filter
4  
-  
  4
+
5 5
   def secondary_before_filter
6 6
     @test_secondary_before_filter = "this is a test"
7 7
   end
8  test_app/app/controllers/articles_controller.rb
... ...
@@ -1,18 +1,18 @@
1 1
 class ArticlesController < ApplicationController
2 2
   before_filter :test_current_user_var
3  
-  
  3
+
4 4
   def test_current_user_var
5 5
     if session[:user_id]
6 6
       @current_user = User.new
7 7
       @current_user.id = session[:user_id]
8 8
     end
9 9
   end
10  
-  
  10
+
11 11
   def index
12 12
     impressionist(Article.first,"this is a test article impression")
13 13
   end
14  
-  
  14
+
15 15
   def show
16 16
     impressionist(Article.first)
17 17
   end
18  
-end
  18
+end
14  test_app/app/controllers/posts_controller.rb
@@ -2,17 +2,17 @@ class PostsController < ApplicationController
2 2
   helper_method :current_user
3 3
   impressionist
4 4
   def index
5  
-    
  5
+
6 6
   end
7  
-  
  7
+
8 8
   def show
9  
-    
  9
+
10 10
   end
11  
-  
  11
+
12 12
   def edit
13  
-    
  13
+
14 14
   end
15  
-  
  15
+
16 16
   def current_user
17 17
     if session[:user_id]
18 18
       user = User.new
@@ -20,4 +20,4 @@ def current_user
20 20
       @current_user ||= user
21 21
     end
22 22
   end
23  
-end
  23
+end
10  test_app/app/controllers/widgets_controller.rb
... ...
@@ -1,13 +1,13 @@
1 1
 class WidgetsController < ApplicationController
2 2
   impressionist :actions=>[:show,:index], :unique => [:controller_name,:action_name,:impressionable_id]
3  
-  
  3
+
4 4
   def show
5 5
   end
6  
-  
  6
+
7 7
   def index
8 8
   end
9  
-  
  9
+
10 10
   def new
11 11
   end
12  
-  
13  
-end
  12
+
  13
+end
2  test_app/app/models/dummy.rb
@@ -4,4 +4,4 @@
4 4
 class Dummy < ActiveRecord::Base
5 5
   self.abstract_class = true # doesn't need to be backed by an actual table
6 6
   is_impressionable
7  
-end
  7
+end
2  test_app/app/models/user.rb
... ...
@@ -1,3 +1,3 @@
1 1
 class User
2 2
   attr_accessor :id
3  
-end
  3
+end
2  test_app/app/views/articles/index.html.erb
... ...
@@ -1 +1 @@
1  
-<%=@impressionist_hash==nil%>
  1
+<%=@impressionist_hash==nil%>
2  test_app/app/views/articles/show.html.erb
... ...
@@ -1 +1 @@
1  
-<%=link_to "Same Page", article_url(Article.first)%>
  1
+<%=link_to "Same Page", article_url(Article.first)%>
4  test_app/config/database.yml
@@ -16,7 +16,7 @@ test: &test
16 16
 #  adapter: postgresql
17 17
 #  database: impressionist_test
18 18
 #  username: johnmcaliley
19  
-# password: 
  19
+# password:
20 20
 #  host: localhost
21 21
 #  encoding: UTF8
22 22
 
@@ -27,4 +27,4 @@ production:
27 27
   timeout: 5000
28 28
 
29 29
 cucumber:
30  
-  <<: *test
  30
+  <<: *test
12  test_app/db/migrate/20111127195013_create_impressions_table.rb
@@ -16,22 +16,22 @@ def self.up
16 16
     end
17 17
     add_index :impressions, [:impressionable_type, :impressionable_id, :request_hash], :name => "poly_request_index", :unique => false
18 18
     add_index :impressions, [:impressionable_type, :impressionable_id, :ip_address], :name => "poly_ip_index", :unique => false
19  
-    add_index :impressions, [:impressionable_type, :impressionable_id, :session_hash], :name => "poly_session_index", :unique => false    
  19
+    add_index :impressions, [:impressionable_type, :impressionable_id, :session_hash], :name => "poly_session_index", :unique => false
20 20
     add_index :impressions, [:controller_name,:action_name,:request_hash], :name => "controlleraction_request_index", :unique => false
21 21
     add_index :impressions, [:controller_name,:action_name,:ip_address], :name => "controlleraction_ip_index", :unique => false
22  
-    add_index :impressions, [:controller_name,:action_name,:session_hash], :name => "controlleraction_session_index", :unique => false        
  22
+    add_index :impressions, [:controller_name,:action_name,:session_hash], :name => "controlleraction_session_index", :unique => false
23 23
     add_index :impressions, :user_id
24 24
   end
25 25
 
26 26
   def self.down
27 27
     remove_index :impressions, :name => :poly_request_index
28 28
     remove_index :impressions, :name => :poly_ip_index
29  
-    remove_index :impressions, :name => :poly_session_index        
  29
+    remove_index :impressions, :name => :poly_session_index
30 30
     remove_index :impressions, :name => :controlleraction_request_index
31 31
     remove_index :impressions, :name => :controlleraction_ip_index
32  
-    remove_index :impressions, :name => :controlleraction_session_index        
  32
+    remove_index :impressions, :name => :controlleraction_session_index
33 33
     remove_index :impressions, :user_id
34  
-    
  34
+
35 35
     drop_table :impressions
36 36
   end
37  
-end
  37
+end
4  test_app/lib/tasks/cucumber.rake
... ...
@@ -1,6 +1,6 @@
1 1
 # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
2  
-# It is recommended to regenerate this file in the future when you upgrade to a 
3  
-# newer version of cucumber-rails. Consider adding your own code to a new file 
  2
+# It is recommended to regenerate this file in the future when you upgrade to a
  3
+# newer version of cucumber-rails. Consider adding your own code to a new file
4 4
 # instead of editing this one. Cucumber will automatically load all features/**/*.rb
5 5
 # files.
6 6
 
2  test_app/public/javascripts/controls.js
@@ -962,4 +962,4 @@ Form.Element.DelayedObserver = Class.create({
962 962
     this.timer = null;
963 963
     this.callback(this.element, $F(this.element));
964 964
   }
965  
-});
  965
+});
2  test_app/public/javascripts/dragdrop.js
@@ -971,4 +971,4 @@ Element.findChildren = function(element, only, recursive, tagName) {
971 971
 
972 972
 Element.offsetSize = function (element, type) {
973 973
   return element['offset' + ((type=='vertical' || type=='height') ? 'Height' : 'Width')];
974  
-};
  974
+};
2  test_app/public/javascripts/effects.js
@@ -1120,4 +1120,4 @@ $w('getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTex
1120 1120
   function(f) { Effect.Methods[f] = Element[f]; }
1121 1121
 );
1122 1122
 
1123  
-Element.addMethods(Effect.Methods);
  1123
+Element.addMethods(Effect.Methods);
10  test_app/spec/controllers/controller_spec.rb
@@ -95,9 +95,9 @@
95 95
     get "show", :id=> 1
96 96
     Impression.all.size.should eq 11
97 97
   end
98  
-  
  98
+
99 99
   describe "impressionist unique options" do
100  
-    
  100
+
101 101
     it "should log unique impressions at the per action level" do
102 102
       get "show", :id=> 1
103 103
       Impression.all.size.should eq 12
@@ -108,7 +108,7 @@
108 108
       get "index"
109 109
       Impression.all.size.should eq 14
110 110
     end
111  
-    
  111
+
112 112
     it "should log unique impressions only once per id" do
113 113
       get "show", :id=> 1
114 114
       Impression.all.size.should eq 12
@@ -119,7 +119,7 @@
119 119
       get "index"
120 120
       Impression.all.size.should eq 14
121 121
     end
122  
-  
  122
+
123 123
   end
124  
-  
  124
+
125 125
 end
2  test_app/spec/fixtures/articles.yml
... ...
@@ -1,3 +1,3 @@
1 1
 one:
2 2
   id: 1
3  
-  name: Test Article
  3
+  name: Test Article
14  test_app/spec/fixtures/impressions.yml
@@ -16,7 +16,7 @@ impression8:
16 16
   session_hash: b1
17 17
   ip_address: 127.0.0.1
18 18
   created_at: 2010-01-01
19  
-  
  19
+
20 20
 impression9:
21 21
   impressionable_type: Article
22 22
   impressionable_id: 1
@@ -24,20 +24,20 @@ impression9:
24 24
   session_hash: b2
25 25
   ip_address: 127.0.0.1
26 26
   created_at: 2011-01-03
27  
-    
  27
+
28 28
 impression10:
29 29
   impressionable_type: Article
30 30
   impressionable_id: 1
31 31
   request_hash: a9
32 32
   session_hash: b3
33 33
   ip_address: 127.0.0.8
34  
-  created_at: 2010-01-01  
35  
-  
  34
+  created_at: 2010-01-01
  35
+
36 36
 impression11:
37 37
   impressionable_type: Article
38 38
   impressionable_id: 1
39 39
   request_hash: a10
40  
-  session_hash: b4  
  40
+  session_hash: b4
41 41
   ip_address: 127.0.0.1
42  
-  created_at: 2010-01-01  
43  
-  
  42
+  created_at: 2010-01-01
  43
+
2  test_app/spec/fixtures/posts.yml
... ...
@@ -1,3 +1,3 @@
1 1
 one:
2 2
   id: 1
3  
-  name: Test Post
  3
+  name: Test Post
2  test_app/spec/fixtures/widgets.yml
... ...
@@ -1,4 +1,4 @@
1 1
 one:
2 2
   id: 1
3 3
   name: A Widget
4  
-  impressions_count: 0
  4
+  impressions_count: 0
6  test_app/spec/intializers/initializers_spec.rb
@@ -5,14 +5,14 @@
5 5
     method = RUBY_VERSION.match("1.8") ? "is_impressionable" : :is_impressionable
6 6
     ActiveRecord::Base.methods.include?(method).should be true
7 7
   end
8  
-  
  8
+
9 9
   it "should include methods in ApplicationController" do
10 10
     method = RUBY_VERSION.match("1.8") ? "impressionist" : :impressionist
11 11
     ApplicationController.instance_methods.include?(method).should be true
12 12
   end
13  
-  
  13
+
14 14
   it "should include the before_filter method in ApplicationController" do
15 15
      filters = ApplicationController._process_action_callbacks.select { |c| c.kind == :before }
16 16
      filters.collect{|filter|filter.filter}.include?(:impressionist_app_filter).should be true
17 17
   end
18  
-end
  18
+end
2  test_app/spec/models/counter_caching_spec.rb
@@ -27,4 +27,4 @@
27 27
     end
28 28
   end
29 29
 
30  
-end
  30
+end
34  test_app/spec/models/model_spec.rb
@@ -2,33 +2,33 @@
2 2
 
3 3
 describe Impression do
4 4
   fixtures :articles,:impressions,:posts
5  
-  
  5
+
6 6
   before(:each) do
7 7
     @article = Article.find(1)
8 8
   end
9  
-  
  9
+
10 10
   it "should save a blank impression for an Article that has 10 impressions" do
11 11
     @article.impressions.create
12 12
     @article.impressions.size.should eq 12
13 13
   end
14  
-  
  14
+
15 15
   it "should save an impression with a message" do
16 16
     @article.impressions.create(:message=>"test message")
17 17
     @article.impressions.last.message.should eq "test message"
18 18
   end
19  
-  
  19
+
20 20
   it "should return the impression count for all with no date range specified" do
21 21
     @article.impressionist_count(:filter=>:all).should eq 11
22 22
   end
23  
-  
  23
+
24 24
   it "should return unique impression count with no date range specified" do
25 25
     @article.impressionist_count.should eq 9
26 26
   end
27  
-  
  27
+
28 28
   it "should return impression count with only start date specified" do
29 29
     @article.impressionist_count(:start_date=>"2011-01-01",:filter=>:all).should eq 8
30 30
   end
31  
-  
  31
+
32 32
   it "should return impression count with whole date range specified" do
33 33
     @article.impressionist_count(:start_date=>"2011-01-01",:end_date=>"2011-01-02",:filter=>:all).should eq 7
34 34
   end
@@ -36,11 +36,11 @@
36 36
   it "should return unique impression count with only start date specified" do
37 37
     @article.impressionist_count(:start_date=>"2011-01-01").should eq 7
38 38
   end
39  
-  
  39
+
40 40
   it "should return unique impression count with date range specified" do
41 41
     @article.impressionist_count(:start_date=>"2011-01-01",:end_date=>"2011-01-02").should eq 7
42 42
   end
43  
-  
  43
+
44 44
   it "should return unique impression count using ip address (which in turn eliminates duplicate request_hashes)" do
45 45
     @article.impressionist_count(:filter=>:ip_address).should eq 8
46 46
   end
@@ -48,7 +48,7 @@
48 48
   it "should return unique impression count using session_hash (which in turn eliminates duplicate request_hashes)" do
49 49
     @article.impressionist_count(:filter=>:session_hash).should eq 7
50 50
   end
51  
-  
  51
+
52 52
   # tests :dependent => :destroy
53 53
   it "should delete impressions on deletion of impressionable" do
54 54
     impressions_count = Impression.all.size
@@ -58,20 +58,20 @@
58 58
     a.destroyed?.should be_true
59 59
     i.destroyed?.should be_true
60 60
   end
61  
-  
  61
+
62 62
   #OLD COUNT METHODS.  DEPRECATE SOON
63 63
   it "should return the impression count with no date range specified" do
64 64
     @article.impression_count.should eq 11
65 65
   end
66  
-  
  66
+
67 67
   it "should return unique impression count with no date range specified" do
68 68
     @article.unique_impression_count.should eq 9
69 69
   end
70  
-  
  70
+
71 71
   it "should return impression count with only start date specified" do
72 72
     @article.impression_count("2011-01-01").should eq 8
73 73
   end
74  
-  
  74
+
75 75
   it "should return impression count with whole date range specified" do
76 76
     @article.impression_count("2011-01-01","2011-01-02").should eq 7
77 77
   end
@@ -79,11 +79,11 @@
79 79
   it "should return unique impression count with only start date specified" do
80 80
     @article.unique_impression_count("2011-01-01").should eq 7
81 81
   end
82  
-  
  82
+
83 83
   it "should return unique impression count with date range specified" do
84 84
     @article.unique_impression_count("2011-01-01","2011-01-02").should eq 7
85 85
   end
86  
-  
  86
+
87 87
   it "should return unique impression count using ip address (which in turn eliminates duplicate request_hashes)" do
88 88
     @article.unique_impression_count_ip.should eq 8
89 89
   end
@@ -91,4 +91,4 @@
91 91
   it "should return unique impression count using session_hash (which in turn eliminates duplicate request_hashes)" do
92 92
     @article.unique_impression_count_session.should eq 7
93 93
   end
94  
-end
  94
+end
4  test_app/spec/rails_generators/rails_generators_spec.rb
@@ -13,9 +13,9 @@
13 13
     migration_name = generator_output.split("migrate/")[1].strip
14 14
     Dir.entries(migrations_dir).include?(migration_name).should be true
15 15
   end
16  
-  
  16
+
17 17
   it "should run the migration created in the previous spec" do
18 18
     migrate_output = systemu("rake db:migrate RAILS_ENV=test")
19 19
     migrate_output[1].include?("CreateImpressionsTable: migrated").should be true
20 20
   end
21  
-end
  21
+end
4  test_app/spec/spec_helper.rb
@@ -24,10 +24,10 @@
24 24
   # examples within a transaction, remove the following line or assign false
25 25
   # instead of true.
26 26
   config.use_transactional_fixtures = true
27  
-  
  27
+
28 28
   # make the rails logger usable in the tests as logger.xxx "..."
29 29
   def logger
30 30
     Rails.logger
31 31
   end
32  
-  
  32
+
33 33
 end
14  upgrade_migrations/version_0_3_0.rb
@@ -5,23 +5,23 @@ def self.up
5 5
     remove_index :impressions, :name => :controlleraction_index
6 6
     add_index :impressions, [:impressionable_type, :impressionable_id, :request_hash], :name => "poly_request_index", :unique => false
7 7
     add_index :impressions, [:impressionable_type, :impressionable_id, :ip_address], :name => "poly_ip_index", :unique => false
8  
-    add_index :impressions, [:impressionable_type, :impressionable_id, :session_hash], :name => "poly_session_index", :unique => false    
  8
+    add_index :impressions, [:impressionable_type, :impressionable_id, :session_hash], :name => "poly_session_index", :unique => false
9 9
     add_index :impressions, [:controller_name,:action_name,:request_hash], :name => "controlleraction_request_index", :unique => false
10 10
     add_index :impressions, [:controller_name,:action_name,:ip_address], :name => "controlleraction_ip_index", :unique => false
11  
-    add_index :impressions, [:controller_name,:action_name,:session_hash], :name => "controlleraction_session_index", :unique => false        
12  
-    
  11
+    add_index :impressions, [:controller_name,:action_name,:session_hash], :name => "controlleraction_session_index", :unique => false
  12
+
13 13
   end
14 14
 
15 15
   def self.down
16 16
     remove_column :impressions, :session_hash
17 17
     remove_index :impressions, :name => :poly_request_index
18 18
     remove_index :impressions, :name => :poly_ip_index
19  
-    remove_index :impressions, :name => :poly_session_index        
  19
+    remove_index :impressions, :name => :poly_session_index
20 20
     remove_index :impressions, :name => :controlleraction_request_index
21 21
     remove_index :impressions, :name => :controlleraction_ip_index
22  
-    remove_index :impressions, :name => :controlleraction_session_index        
  22
+    remove_index :impressions, :name => :controlleraction_session_index
23 23
     remove_index :impressions, :user_id
24 24
     add_index :impressions, [:impressionable_type, :impressionable_id, :request_hash, :ip_address], :name => "poly_index", :unique => false
25  
-    add_index :impressions, [:controller_name,:action_name,:request_hash,:ip_address], :name => "controlleraction_index", :unique => false    
  25
+    add_index :impressions, [:controller_name,:action_name,:request_hash,:ip_address], :name => "controlleraction_index", :unique => false
26 26
   end
27  
-end
  27
+end
4  upgrade_migrations/version_0_4_0.rb
... ...
@@ -1,9 +1,9 @@
1 1
 class Version04UpdateImpressionsTable < ActiveRecord::Migration
2 2
   def self.up
3  
-    add_column :impressions, :referrer, :string    
  3
+    add_column :impressions, :referrer, :string
4 4
   end
5 5
 
6 6
   def self.down
7 7
     remove_column :impressions, :referrer
8 8
   end
9  
-end
  9
+end

0 notes on commit 1174647

Please sign in to comment.
Something went wrong with that request. Please try again.