due_credit 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,6 +2,7 @@ module DueCredit
2
2
  class CreditController < ::ApplicationController
3
3
  def click_through
4
4
  @referrer = Referrer.find_by_token(params[:token])
5
+ session[:token] = params[:token]
5
6
  Referral.create!(referrer: @referrer)
6
7
  redirect_to @referrer.campaign.endpoint
7
8
  end
@@ -1,7 +1,7 @@
1
1
  module DueCredit
2
2
  class Referral < ActiveRecord::Base
3
3
  attr_accessible :referrer
4
- belongs_to :referrer
4
+ belongs_to :referrer, counter_cache: true
5
5
  validates_presence_of :referrer_id
6
6
  end
7
- end
7
+ end
@@ -30,4 +30,4 @@ module DueCredit
30
30
  end
31
31
 
32
32
  end
33
- end
33
+ end
@@ -1,3 +1,3 @@
1
1
  module DueCredit
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -20,4 +20,4 @@ class DueCreditGenerator < Rails::Generators::Base
20
20
  def create_migration_file
21
21
  migration_template 'migration.rb', 'db/migrate/create_due_credit_tables.rb'
22
22
  end
23
- end
23
+ end
@@ -12,6 +12,7 @@ class CreateDueCreditTables < ActiveRecord::Migration
12
12
  t.string :token
13
13
  t.string :model
14
14
  t.integer :model_id
15
+ t.integer :referrals_count
15
16
  t.references :campaign
16
17
  t.timestamps
17
18
  end
@@ -37,4 +38,4 @@ class CreateDueCreditTables < ActiveRecord::Migration
37
38
  drop_table :referrals
38
39
 
39
40
  end
40
- end
41
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: due_credit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-16 00:00:00.000000000 Z
12
+ date: 2013-05-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -68,6 +68,7 @@ files:
68
68
  - lib/due_credit/engine.rb
69
69
  - lib/due_credit/version.rb
70
70
  - lib/generators/due_credit/due_credit_generator.rb
71
+ - lib/generators/due_credit/templates/add_counter_cache.rb
71
72
  - lib/generators/due_credit/templates/migration.rb
72
73
  - test/due_credit_test.rb
73
74
  - test/dummy/Rakefile
@@ -127,5 +128,5 @@ rubyforge_project:
127
128
  rubygems_version: 1.8.23
128
129
  signing_key:
129
130
  specification_version: 3
130
- summary: due_credit-0.1.1
131
+ summary: due_credit-0.1.2
131
132
  test_files: []