ifd_tools 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -26,4 +26,23 @@ To install:
26
26
  2. To track specific events, create subclasses of `IfdTools::Tracking::Event` in your application, in `app/models/ifd_tools/tracking` folder.
27
27
  3. Be sure to override the `assign_trackable_item_by_id` method per subclass (default implement is to raise an exception)
28
28
  4. Tracking requests can be initiated via the API at `/api/track.xml?type=product_event&id=14`. The `type` parameter is the class name without the module prefixes, underscored -> "IfdTools::Tracking::ProductEvent" should be sent as "product_event".
29
- 5. Also have "batch tracking" functionality available, which will accept JSON or XML in a request to process multiple entries. Each "event" is id, type and optionally timestamp (UNIX) or platform.
29
+ 5. Also have "batch tracking" functionality available, which will accept JSON or XML in a request to process multiple entries. Each "event" is id, type and optionally timestamp (UNIX) or platform.
30
+
31
+ ## Customer Creation
32
+
33
+ A special helper method is provided on the `ApiController` class to facilitate easy Customer creation. There is plenty of inline documentation on usage there, but here's an example:
34
+
35
+ class ApiController < ApplicationController
36
+
37
+ before_filter :authenticate_customer!, :except => [:software_updates, :emergency_messages, :notifier_updates]
38
+ respond_to :json, :xml
39
+
40
+ include IfdTools::ApiControllerExtensions
41
+
42
+ create_customer do |customer|
43
+ # customer = Customer.new(params[:customer]) already passed in to us, just handle special use cases for data transformations
44
+ customer.account_level = CustomerAccountLevel.find_by_abbreviation(params[:account_level])
45
+ customer
46
+ end
47
+
48
+ end
@@ -1,6 +1,6 @@
1
1
  class ApiController < ApplicationController
2
2
 
3
- before_filter :authenticate_customer!, :except => [:software_updates, :emergency_messages, :notifier_updates]
3
+ before_filter :authenticate_customer!, :except => [:create_customer, :software_updates, :emergency_messages, :notifier_updates]
4
4
  respond_to :json, :xml
5
5
 
6
6
  include IfdTools::ApiControllerExtensions
@@ -1,3 +1,3 @@
1
1
  module IfdTools
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
data/lib/ifd_tools.rb CHANGED
@@ -10,6 +10,7 @@ require 'stringex'
10
10
  require 'daemons'
11
11
  require 'haml'
12
12
  require 'swfobject-rails'
13
+ require 'active_admin_relationship_filters'
13
14
 
14
15
  require "ifd_tools/engine"
15
16
  require 'ifd_tools/date_time_additions'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ifd_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -235,6 +235,22 @@ dependencies:
235
235
  - - ! '>='
236
236
  - !ruby/object:Gem::Version
237
237
  version: '0'
238
+ - !ruby/object:Gem::Dependency
239
+ name: active_admin_relationship_filters
240
+ requirement: !ruby/object:Gem::Requirement
241
+ none: false
242
+ requirements:
243
+ - - ! '>='
244
+ - !ruby/object:Gem::Version
245
+ version: '0'
246
+ type: :runtime
247
+ prerelease: false
248
+ version_requirements: !ruby/object:Gem::Requirement
249
+ none: false
250
+ requirements:
251
+ - - ! '>='
252
+ - !ruby/object:Gem::Version
253
+ version: '0'
238
254
  - !ruby/object:Gem::Dependency
239
255
  name: sqlite3
240
256
  requirement: !ruby/object:Gem::Requirement