cheddargetter_client_rails 0.1.15 → 0.1.16

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -5,15 +5,24 @@ Much of the heavy lifting with the api itself is done through the cheddargetter_
5
5
 
6
6
  == Usage
7
7
 
8
+ == Starting Out
9
+
10
+ Run the generator to get the config files
11
+
12
+ rails g cheddargetter
13
+
14
+ This will create /config/initializers/cheddargetter_client.rb and /config/cheddargetter.yml
15
+ Please edit /config/cheddargetter.yml to include your CheddarGetter credentials.
16
+
8
17
  === In the model
9
18
 
10
19
  It can be very simple if you go with the default columns, ie:
11
20
 
12
- :customerCode => :id
13
- :email => :email,
14
- :firstName => :first_name,
15
- :lastName => :last_name,
16
- :planCode => :plan_code
21
+ :customerCode => :id
22
+ :email => :email,
23
+ :firstName => :first_name,
24
+ :lastName => :last_name,
25
+ :planCode => :plan_code
17
26
 
18
27
  Then the declaration in the model is simply:
19
28
 
@@ -36,15 +45,15 @@ Note that the plan code can also take a string.
36
45
 
37
46
  The has_subscription will also takes additional key/values of items that appear both in your records for the user and CheddarGetter's records. For instance zip code is a common one. Here are others:
38
47
 
39
- :ccFirstName,
40
- :ccLastName,
41
- :ccExpiration,
42
- :ccNumber,
43
- :ccCountry,
44
- :ccAddress,
45
- :ccCity,
46
- :ccState,
47
- :company,
48
+ :ccFirstName
49
+ :ccLastName
50
+ :ccExpiration
51
+ :ccNumber
52
+ :ccCountry
53
+ :ccAddress
54
+ :ccCity
55
+ :ccState
56
+ :company
48
57
  :zip
49
58
 
50
59
  When the save is called on the subscription object or create is called on the user it grabs all shared attributes from your ActiveRecord record.
@@ -71,7 +80,7 @@ Make sure the subscription is always set on the user as some data may only exist
71
80
 
72
81
  Or in a user controller
73
82
 
74
- class UsersController < ApplicationController
83
+ class UsersController < ApplicationController
75
84
  def new
76
85
  @user = User.new
77
86
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.15
1
+ 0.1.16
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cheddargetter_client_rails}
8
- s.version = "0.1.15"
8
+ s.version = "0.1.16"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Brent Wooden"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cheddargetter_client_rails
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 59
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 15
10
- version: 0.1.15
9
+ - 16
10
+ version: 0.1.16
11
11
  platform: ruby
12
12
  authors:
13
13
  - Brent Wooden