landing_page 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,13 +6,18 @@ module LandingPage
6
6
  :message => 'The email is not valid'
7
7
  validates_uniqueness_of :email
8
8
 
9
+ before_create :set_locale
9
10
  after_save :add_to_campaign_monitor
10
11
 
11
12
  private
12
13
  def add_to_campaign_monitor
13
14
  if LandingPage.campaign_monitor_api_key && LandingPage.campaign_monitor_list_id
14
- CreateSend::Subscriber.add({api_key: LandingPage.campaign_monitor_api_key}, LandingPage.campaign_monitor_list_id, email, name, [], true)
15
+ CreateSend::Subscriber.add({api_key: LandingPage.campaign_monitor_api_key}, LandingPage.campaign_monitor_list_id, email, name, [{:Key => 'locale', :Value => locale}], true)
15
16
  end
16
17
  end
18
+
19
+ def set_locale
20
+ self.locale = I18n.locale.to_s
21
+ end
17
22
  end
18
23
  end
@@ -0,0 +1,5 @@
1
+ class AddLocaleToLandingPageUsers < ActiveRecord::Migration
2
+ def change
3
+ add_column :landing_page_users, :locale, :string
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module LandingPage
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: landing_page
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.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-07-29 00:00:00.000000000 Z
12
+ date: 2013-07-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -166,6 +166,7 @@ files:
166
166
  - config/environment.rb
167
167
  - config/locales/en.yml
168
168
  - db/migrate/20130727152153_add_name_to_landing_page_users.rb
169
+ - db/migrate/20130730071415_add_locale_to_landing_page_users.rb
169
170
  - db/migrate/20130727104115_create_landing_page_users.rb
170
171
  - lib/landing_page.rb
171
172
  - lib/landing_page/version.rb
@@ -175,7 +176,8 @@ files:
175
176
  - Rakefile
176
177
  - README.rdoc
177
178
  homepage: https://github.com/laMarciana/landing_page
178
- licenses: []
179
+ licenses:
180
+ - GPL3
179
181
  post_install_message:
180
182
  rdoc_options: []
181
183
  require_paths: