ccs_survey_gem 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/app/dbmigrations/20101216192248_create_survey_campaigns.rb +29 -0
- data/app/dbmigrations/20101221140343_create_campaign_categories.rb +16 -0
- data/app/dbmigrations/20110107065603_create_survey_categories.rb +28 -0
- data/app/models/instant_dollarz_campaign.rb +2 -8
- data/app/models/survey_campaign.rb +3 -0
- data/config/initializers/load_survey_config.rb +2 -0
- data/config/surveyconfig.yml +17 -0
- data/lib/ccs_survey_gem/version.rb +1 -1
- data/nbproject/private/rake-d.txt +3 -3
- data/nbproject/project.properties +1 -0
- data/nbproject/project.xml +1 -0
- metadata +9 -4
@@ -0,0 +1,29 @@
|
|
1
|
+
class CreateSurveyCampaigns < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :survey_campaigns do |t|
|
4
|
+
t.string :type
|
5
|
+
t.integer :position
|
6
|
+
t.integer :campaign_id
|
7
|
+
t.integer :campaign_category_id
|
8
|
+
t.boolean :updated, :default => false
|
9
|
+
t.boolean :current, :default => true
|
10
|
+
t.string :offer_name
|
11
|
+
t.decimal :commission, :precision => 8, :scale => 2
|
12
|
+
t.string :banner_size
|
13
|
+
t.string :offer_url
|
14
|
+
t.string :banner_url
|
15
|
+
t.text :description
|
16
|
+
t.string :reporting
|
17
|
+
t.string :category
|
18
|
+
t.string :countries
|
19
|
+
t.integer :positive_vote_count
|
20
|
+
t.integer :negative_vote_count
|
21
|
+
|
22
|
+
t.timestamps
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.down
|
27
|
+
drop_table :survey_campaigns
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateCampaignCategories < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :campaign_categories do |t|
|
4
|
+
t.string :type
|
5
|
+
t.integer :instant_dollarz_category_id
|
6
|
+
t.string :name
|
7
|
+
t.boolean :visible, :default => true
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
drop_table :campaign_categories
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
class CreateSurveyCategories < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :survey_categories do |t|
|
4
|
+
t.string :type
|
5
|
+
t.integer :instant_dollarz_category_id
|
6
|
+
t.string :name
|
7
|
+
t.boolean :visible, :default => true
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
rename_column :survey_campaigns, :campaign_category_id, :survey_category_id
|
12
|
+
drop_table :campaign_categories
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.down
|
16
|
+
drop_table :survey_categories
|
17
|
+
create_table :campaign_categories do |t|
|
18
|
+
t.string :type
|
19
|
+
t.integer :instant_dollarz_category_id
|
20
|
+
t.string :name
|
21
|
+
t.boolean :visible, :default => true
|
22
|
+
|
23
|
+
t.timestamps
|
24
|
+
end
|
25
|
+
rename_column :survey_campaigns, :survey_category_id, :campaign_category_id
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
@@ -6,7 +6,7 @@ class InstantDollarzCampaign < SurveyCampaign
|
|
6
6
|
belongs_to :instant_dollarz_category, :foreign_key => 'survey_category_id'
|
7
7
|
|
8
8
|
def url_to_campaign(user_id)
|
9
|
-
"#{self.offer_url}&subid=#{user_id}&sid=#{SiteDetail.get_site_id}
|
9
|
+
"#{self.offer_url}&subid=#{user_id}&sid=#{SiteDetail.get_site_id}"
|
10
10
|
end
|
11
11
|
|
12
12
|
def self.import
|
@@ -31,7 +31,7 @@ class InstantDollarzCampaign < SurveyCampaign
|
|
31
31
|
|
32
32
|
private
|
33
33
|
def self.get_report_path
|
34
|
-
'/subscription_data_generator/?username=
|
34
|
+
'/subscription_data_generator/?username=SURVEY_CONFIG[:instantdollarz][:username]&key=SURVEY_CONFIG[:instantdollarz][:csvkey]&format=tab_bare'
|
35
35
|
end
|
36
36
|
|
37
37
|
def self.download_instantdollarz_campaigns
|
@@ -64,12 +64,6 @@ class InstantDollarzCampaign < SurveyCampaign
|
|
64
64
|
category.name = words[8]
|
65
65
|
end
|
66
66
|
sc.instant_dollarz_category = category
|
67
|
-
if words[0].to_i == 4233
|
68
|
-
puts("@@@@ Category is #{words[8]} - should be - Adult - ac.category is #{sc.instant_dollarz_category.name}")
|
69
|
-
end
|
70
|
-
if sc.instant_dollarz_category.blank?
|
71
|
-
puts("@@@@ Category is blank!")
|
72
|
-
end
|
73
67
|
sc.campaign_id = words[0].to_i
|
74
68
|
sc.offer_name = words[1]
|
75
69
|
sc.commission = words[2]
|
@@ -0,0 +1,17 @@
|
|
1
|
+
development:
|
2
|
+
:instantdollarz:
|
3
|
+
:username: your user name here
|
4
|
+
:csvkey: Your csv download key here
|
5
|
+
:points_to_pounds_ratio: How many points = £1
|
6
|
+
|
7
|
+
test:
|
8
|
+
:instantdollarz:
|
9
|
+
:username: your user name here
|
10
|
+
:csvkey: Your csv download key here
|
11
|
+
:points_to_pounds_ratio: How many points = £1
|
12
|
+
|
13
|
+
production:
|
14
|
+
:instantdollarz:
|
15
|
+
:username: your user name here
|
16
|
+
:csvkey: Your csv download key here
|
17
|
+
:points_to_pounds_ratio: How many points = £1
|
@@ -1,3 +1,3 @@
|
|
1
|
-
build=Build ccs_survey_gem-0.0.
|
2
|
-
install=Build and install ccs_survey_gem-0.0.
|
3
|
-
release=Create tag v0.0.
|
1
|
+
build=Build ccs_survey_gem-0.0.2.gem into the pkg directory
|
2
|
+
install=Build and install ccs_survey_gem-0.0.2.gem into system gems
|
3
|
+
release=Create tag v0.0.2 and build and push ccs_survey_gem-0.0.2.gem to Rubygems
|
data/nbproject/project.xml
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ccs_survey_gem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- James West
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-01-
|
18
|
+
date: 2011-01-13 00:00:00 +00:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -32,11 +32,16 @@ files:
|
|
32
32
|
- .gitignore
|
33
33
|
- Gemfile
|
34
34
|
- Rakefile
|
35
|
+
- app/dbmigrations/20101216192248_create_survey_campaigns.rb
|
36
|
+
- app/dbmigrations/20101221140343_create_campaign_categories.rb
|
37
|
+
- app/dbmigrations/20110107065603_create_survey_categories.rb
|
35
38
|
- app/models/instant_dollarz_campaign.rb
|
36
39
|
- app/models/instant_dollarz_category.rb
|
37
40
|
- app/models/survey_campaign.rb
|
38
41
|
- app/models/survey_category.rb
|
39
42
|
- ccs_survey_gem.gemspec
|
43
|
+
- config/initializers/load_survey_config.rb
|
44
|
+
- config/surveyconfig.yml
|
40
45
|
- lib/ccs_survey_gem.rb
|
41
46
|
- lib/ccs_survey_gem/engine.rb
|
42
47
|
- lib/ccs_survey_gem/version.rb
|