cheddargetter_client_rails 0.1.15 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +24 -15
- data/VERSION +1 -1
- data/cheddargetter_client_rails.gemspec +1 -1
- metadata +3 -3
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
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
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
|
-
|
83
|
+
class UsersController < ApplicationController
|
75
84
|
def new
|
76
85
|
@user = User.new
|
77
86
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.16
|
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:
|
4
|
+
hash: 59
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 16
|
10
|
+
version: 0.1.16
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Brent Wooden
|