ffcrm_endpoint 0.1.0

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.
Files changed (49) hide show
  1. checksums.yaml +15 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +77 -0
  4. data/Rakefile +38 -0
  5. data/app/controllers/ffcrm_endpoint/endpoints_controller.rb +26 -0
  6. data/app/views/ffcrm_endpoint/endpoints/consume.html.haml +4 -0
  7. data/app/views/ffcrm_endpoint/endpoints/consume.js.erb +0 -0
  8. data/config/routes.rb +5 -0
  9. data/lib/ffcrm_endpoint/endpoint.rb +78 -0
  10. data/lib/ffcrm_endpoint/engine.rb +16 -0
  11. data/lib/ffcrm_endpoint/version.rb +3 -0
  12. data/lib/ffcrm_endpoint.rb +4 -0
  13. data/lib/tasks/ffcrm_endpoint_tasks.rake +4 -0
  14. data/spec/controllers/endpoints_controller_spec.rb +27 -0
  15. data/spec/dummy/README.rdoc +261 -0
  16. data/spec/dummy/Rakefile +7 -0
  17. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  18. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  19. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  20. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  21. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  22. data/spec/dummy/config/application.rb +65 -0
  23. data/spec/dummy/config/boot.rb +10 -0
  24. data/spec/dummy/config/database.yml +17 -0
  25. data/spec/dummy/config/environment.rb +5 -0
  26. data/spec/dummy/config/environments/development.rb +37 -0
  27. data/spec/dummy/config/environments/production.rb +67 -0
  28. data/spec/dummy/config/environments/test.rb +37 -0
  29. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  30. data/spec/dummy/config/initializers/inflections.rb +15 -0
  31. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  32. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  33. data/spec/dummy/config/initializers/session_store.rb +8 -0
  34. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  35. data/spec/dummy/config/locales/en.yml +5 -0
  36. data/spec/dummy/config/routes.rb +58 -0
  37. data/spec/dummy/config.ru +4 -0
  38. data/spec/dummy/db/schema.rb +457 -0
  39. data/spec/dummy/log/development.log +221 -0
  40. data/spec/dummy/log/test.log +374 -0
  41. data/spec/dummy/public/404.html +26 -0
  42. data/spec/dummy/public/422.html +26 -0
  43. data/spec/dummy/public/500.html +25 -0
  44. data/spec/dummy/public/favicon.ico +0 -0
  45. data/spec/dummy/script/rails +6 -0
  46. data/spec/lib/endpoint_spec.rb +34 -0
  47. data/spec/routing/endpoint_routing_spec.rb +21 -0
  48. data/spec/spec_helper.rb +17 -0
  49. metadata +197 -0
@@ -0,0 +1,457 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended to check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(:version => 20130312064954) do
15
+
16
+ create_table "account_aliases", :force => true do |t|
17
+ t.integer "account_id"
18
+ t.integer "destroyed_account_id"
19
+ t.datetime "created_at", :null => false
20
+ t.datetime "updated_at", :null => false
21
+ end
22
+
23
+ create_table "account_contacts", :force => true do |t|
24
+ t.integer "account_id"
25
+ t.integer "contact_id"
26
+ t.datetime "deleted_at"
27
+ t.datetime "created_at", :null => false
28
+ t.datetime "updated_at", :null => false
29
+ end
30
+
31
+ create_table "account_opportunities", :force => true do |t|
32
+ t.integer "account_id"
33
+ t.integer "opportunity_id"
34
+ t.datetime "deleted_at"
35
+ t.datetime "created_at", :null => false
36
+ t.datetime "updated_at", :null => false
37
+ end
38
+
39
+ create_table "accounts", :force => true do |t|
40
+ t.integer "user_id"
41
+ t.integer "assigned_to"
42
+ t.string "name", :limit => 64, :default => "", :null => false
43
+ t.string "access", :limit => 8, :default => "Public"
44
+ t.string "website", :limit => 64
45
+ t.string "toll_free_phone", :limit => 32
46
+ t.string "phone", :limit => 32
47
+ t.string "fax", :limit => 32
48
+ t.datetime "deleted_at"
49
+ t.datetime "created_at", :null => false
50
+ t.datetime "updated_at", :null => false
51
+ t.string "email", :limit => 64
52
+ t.string "background_info"
53
+ t.integer "rating", :default => 0, :null => false
54
+ t.string "category", :limit => 32
55
+ t.text "subscribed_users"
56
+ end
57
+
58
+ add_index "accounts", ["assigned_to"], :name => "index_accounts_on_assigned_to"
59
+ add_index "accounts", ["user_id", "name", "deleted_at"], :name => "index_accounts_on_user_id_and_name_and_deleted_at", :unique => true
60
+
61
+ create_table "activities", :force => true do |t|
62
+ t.integer "user_id"
63
+ t.integer "subject_id"
64
+ t.string "subject_type"
65
+ t.string "action", :limit => 32, :default => "created"
66
+ t.string "info", :default => ""
67
+ t.boolean "private", :default => false
68
+ t.datetime "created_at", :null => false
69
+ t.datetime "updated_at", :null => false
70
+ end
71
+
72
+ add_index "activities", ["created_at"], :name => "index_activities_on_created_at"
73
+ add_index "activities", ["user_id"], :name => "index_activities_on_user_id"
74
+
75
+ create_table "addresses", :force => true do |t|
76
+ t.string "street1"
77
+ t.string "street2"
78
+ t.string "city", :limit => 64
79
+ t.string "state", :limit => 64
80
+ t.string "zipcode", :limit => 16
81
+ t.string "country", :limit => 64
82
+ t.string "full_address"
83
+ t.string "address_type", :limit => 16
84
+ t.integer "addressable_id"
85
+ t.string "addressable_type"
86
+ t.datetime "created_at", :null => false
87
+ t.datetime "updated_at", :null => false
88
+ t.datetime "deleted_at"
89
+ end
90
+
91
+ add_index "addresses", ["addressable_id", "addressable_type"], :name => "index_addresses_on_addressable_id_and_addressable_type"
92
+
93
+ create_table "avatars", :force => true do |t|
94
+ t.integer "user_id"
95
+ t.integer "entity_id"
96
+ t.string "entity_type"
97
+ t.integer "image_file_size"
98
+ t.string "image_file_name"
99
+ t.string "image_content_type"
100
+ t.datetime "created_at", :null => false
101
+ t.datetime "updated_at", :null => false
102
+ end
103
+
104
+ create_table "campaigns", :force => true do |t|
105
+ t.integer "user_id"
106
+ t.integer "assigned_to"
107
+ t.string "name", :limit => 64, :default => "", :null => false
108
+ t.string "access", :limit => 8, :default => "Public"
109
+ t.string "status", :limit => 64
110
+ t.decimal "budget", :precision => 12, :scale => 2
111
+ t.integer "target_leads"
112
+ t.float "target_conversion"
113
+ t.decimal "target_revenue", :precision => 12, :scale => 2
114
+ t.integer "leads_count"
115
+ t.integer "opportunities_count"
116
+ t.decimal "revenue", :precision => 12, :scale => 2
117
+ t.date "starts_on"
118
+ t.date "ends_on"
119
+ t.text "objectives"
120
+ t.datetime "deleted_at"
121
+ t.datetime "created_at", :null => false
122
+ t.datetime "updated_at", :null => false
123
+ t.string "background_info"
124
+ t.text "subscribed_users"
125
+ end
126
+
127
+ add_index "campaigns", ["assigned_to"], :name => "index_campaigns_on_assigned_to"
128
+ add_index "campaigns", ["user_id", "name", "deleted_at"], :name => "index_campaigns_on_user_id_and_name_and_deleted_at", :unique => true
129
+
130
+ create_table "comments", :force => true do |t|
131
+ t.integer "user_id"
132
+ t.integer "commentable_id"
133
+ t.string "commentable_type"
134
+ t.boolean "private"
135
+ t.string "title", :default => ""
136
+ t.text "comment"
137
+ t.datetime "created_at", :null => false
138
+ t.datetime "updated_at", :null => false
139
+ t.string "state", :limit => 16, :default => "Expanded", :null => false
140
+ end
141
+
142
+ create_table "contact_aliases", :force => true do |t|
143
+ t.integer "contact_id"
144
+ t.integer "destroyed_contact_id"
145
+ t.datetime "created_at", :null => false
146
+ t.datetime "updated_at", :null => false
147
+ end
148
+
149
+ create_table "contact_opportunities", :force => true do |t|
150
+ t.integer "contact_id"
151
+ t.integer "opportunity_id"
152
+ t.string "role", :limit => 32
153
+ t.datetime "deleted_at"
154
+ t.datetime "created_at", :null => false
155
+ t.datetime "updated_at", :null => false
156
+ end
157
+
158
+ create_table "contacts", :force => true do |t|
159
+ t.integer "user_id"
160
+ t.integer "lead_id"
161
+ t.integer "assigned_to"
162
+ t.integer "reports_to"
163
+ t.string "first_name", :limit => 64, :default => "", :null => false
164
+ t.string "last_name", :limit => 64, :default => "", :null => false
165
+ t.string "access", :limit => 8, :default => "Public"
166
+ t.string "title", :limit => 64
167
+ t.string "department", :limit => 64
168
+ t.string "source", :limit => 32
169
+ t.string "email", :limit => 64
170
+ t.string "alt_email", :limit => 64
171
+ t.string "phone", :limit => 32
172
+ t.string "mobile", :limit => 32
173
+ t.string "fax", :limit => 32
174
+ t.string "blog", :limit => 128
175
+ t.string "linkedin", :limit => 128
176
+ t.string "facebook", :limit => 128
177
+ t.string "twitter", :limit => 128
178
+ t.date "born_on"
179
+ t.boolean "do_not_call", :default => false, :null => false
180
+ t.datetime "deleted_at"
181
+ t.datetime "created_at", :null => false
182
+ t.datetime "updated_at", :null => false
183
+ t.string "background_info"
184
+ t.string "skype", :limit => 128
185
+ t.text "subscribed_users"
186
+ end
187
+
188
+ add_index "contacts", ["assigned_to"], :name => "index_contacts_on_assigned_to"
189
+ add_index "contacts", ["user_id", "last_name", "deleted_at"], :name => "id_last_name_deleted", :unique => true
190
+
191
+ create_table "emails", :force => true do |t|
192
+ t.string "imap_message_id", :null => false
193
+ t.integer "user_id"
194
+ t.integer "mediator_id"
195
+ t.string "mediator_type"
196
+ t.string "sent_from", :null => false
197
+ t.string "sent_to", :null => false
198
+ t.string "cc"
199
+ t.string "bcc"
200
+ t.string "subject"
201
+ t.text "body"
202
+ t.text "header"
203
+ t.datetime "sent_at"
204
+ t.datetime "received_at"
205
+ t.datetime "deleted_at"
206
+ t.datetime "created_at", :null => false
207
+ t.datetime "updated_at", :null => false
208
+ t.string "state", :limit => 16, :default => "Expanded", :null => false
209
+ end
210
+
211
+ add_index "emails", ["mediator_id", "mediator_type"], :name => "index_emails_on_mediator_id_and_mediator_type"
212
+
213
+ create_table "field_groups", :force => true do |t|
214
+ t.string "name", :limit => 64
215
+ t.string "label", :limit => 128
216
+ t.integer "position"
217
+ t.string "hint"
218
+ t.datetime "created_at", :null => false
219
+ t.datetime "updated_at", :null => false
220
+ t.integer "tag_id"
221
+ t.string "klass_name", :limit => 32
222
+ end
223
+
224
+ create_table "fields", :force => true do |t|
225
+ t.string "type"
226
+ t.integer "field_group_id"
227
+ t.integer "position"
228
+ t.string "name", :limit => 64
229
+ t.string "label", :limit => 128
230
+ t.string "hint"
231
+ t.string "placeholder"
232
+ t.string "as", :limit => 32
233
+ t.text "collection"
234
+ t.boolean "disabled"
235
+ t.boolean "required"
236
+ t.integer "maxlength"
237
+ t.datetime "created_at", :null => false
238
+ t.datetime "updated_at", :null => false
239
+ t.integer "pair_id"
240
+ t.text "settings"
241
+ end
242
+
243
+ add_index "fields", ["field_group_id"], :name => "index_fields_on_field_group_id"
244
+ add_index "fields", ["name"], :name => "index_fields_on_name"
245
+
246
+ create_table "groups", :force => true do |t|
247
+ t.string "name"
248
+ t.datetime "created_at", :null => false
249
+ t.datetime "updated_at", :null => false
250
+ end
251
+
252
+ create_table "groups_users", :id => false, :force => true do |t|
253
+ t.integer "group_id"
254
+ t.integer "user_id"
255
+ end
256
+
257
+ add_index "groups_users", ["group_id", "user_id"], :name => "index_groups_users_on_group_id_and_user_id"
258
+ add_index "groups_users", ["group_id"], :name => "index_groups_users_on_group_id"
259
+ add_index "groups_users", ["user_id"], :name => "index_groups_users_on_user_id"
260
+
261
+ create_table "leads", :force => true do |t|
262
+ t.integer "user_id"
263
+ t.integer "campaign_id"
264
+ t.integer "assigned_to"
265
+ t.string "first_name", :limit => 64, :default => "", :null => false
266
+ t.string "last_name", :limit => 64, :default => "", :null => false
267
+ t.string "access", :limit => 8, :default => "Public"
268
+ t.string "title", :limit => 64
269
+ t.string "company", :limit => 64
270
+ t.string "source", :limit => 32
271
+ t.string "status", :limit => 32
272
+ t.string "referred_by", :limit => 64
273
+ t.string "email", :limit => 64
274
+ t.string "alt_email", :limit => 64
275
+ t.string "phone", :limit => 32
276
+ t.string "mobile", :limit => 32
277
+ t.string "blog", :limit => 128
278
+ t.string "linkedin", :limit => 128
279
+ t.string "facebook", :limit => 128
280
+ t.string "twitter", :limit => 128
281
+ t.integer "rating", :default => 0, :null => false
282
+ t.boolean "do_not_call", :default => false, :null => false
283
+ t.datetime "deleted_at"
284
+ t.datetime "created_at", :null => false
285
+ t.datetime "updated_at", :null => false
286
+ t.string "background_info"
287
+ t.string "skype", :limit => 128
288
+ t.text "subscribed_users"
289
+ end
290
+
291
+ add_index "leads", ["assigned_to"], :name => "index_leads_on_assigned_to"
292
+ add_index "leads", ["user_id", "last_name", "deleted_at"], :name => "index_leads_on_user_id_and_last_name_and_deleted_at", :unique => true
293
+
294
+ create_table "lists", :force => true do |t|
295
+ t.string "name"
296
+ t.text "url"
297
+ t.datetime "created_at", :null => false
298
+ t.datetime "updated_at", :null => false
299
+ end
300
+
301
+ create_table "opportunities", :force => true do |t|
302
+ t.integer "user_id"
303
+ t.integer "campaign_id"
304
+ t.integer "assigned_to"
305
+ t.string "name", :limit => 64, :default => "", :null => false
306
+ t.string "access", :limit => 8, :default => "Public"
307
+ t.string "source", :limit => 32
308
+ t.string "stage", :limit => 32
309
+ t.integer "probability"
310
+ t.decimal "amount", :precision => 12, :scale => 2
311
+ t.decimal "discount", :precision => 12, :scale => 2
312
+ t.date "closes_on"
313
+ t.datetime "deleted_at"
314
+ t.datetime "created_at", :null => false
315
+ t.datetime "updated_at", :null => false
316
+ t.string "background_info"
317
+ t.text "subscribed_users"
318
+ end
319
+
320
+ add_index "opportunities", ["assigned_to"], :name => "index_opportunities_on_assigned_to"
321
+ add_index "opportunities", ["user_id", "name", "deleted_at"], :name => "id_name_deleted", :unique => true
322
+
323
+ create_table "permissions", :force => true do |t|
324
+ t.integer "user_id"
325
+ t.integer "asset_id"
326
+ t.string "asset_type"
327
+ t.datetime "created_at", :null => false
328
+ t.datetime "updated_at", :null => false
329
+ t.integer "group_id"
330
+ end
331
+
332
+ add_index "permissions", ["asset_id", "asset_type"], :name => "index_permissions_on_asset_id_and_asset_type"
333
+ add_index "permissions", ["group_id"], :name => "index_permissions_on_group_id"
334
+ add_index "permissions", ["user_id"], :name => "index_permissions_on_user_id"
335
+
336
+ create_table "preferences", :force => true do |t|
337
+ t.integer "user_id"
338
+ t.string "name", :limit => 32, :default => "", :null => false
339
+ t.text "value"
340
+ t.datetime "created_at", :null => false
341
+ t.datetime "updated_at", :null => false
342
+ end
343
+
344
+ add_index "preferences", ["user_id", "name"], :name => "index_preferences_on_user_id_and_name"
345
+
346
+ create_table "sessions", :force => true do |t|
347
+ t.string "session_id", :null => false
348
+ t.text "data"
349
+ t.datetime "created_at", :null => false
350
+ t.datetime "updated_at", :null => false
351
+ end
352
+
353
+ add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
354
+ add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"
355
+
356
+ create_table "settings", :force => true do |t|
357
+ t.string "name", :limit => 32, :default => "", :null => false
358
+ t.text "value"
359
+ t.datetime "created_at", :null => false
360
+ t.datetime "updated_at", :null => false
361
+ end
362
+
363
+ add_index "settings", ["name"], :name => "index_settings_on_name"
364
+
365
+ create_table "taggings", :force => true do |t|
366
+ t.integer "tag_id"
367
+ t.integer "taggable_id"
368
+ t.integer "tagger_id"
369
+ t.string "tagger_type"
370
+ t.string "taggable_type", :limit => 50
371
+ t.string "context", :limit => 50
372
+ t.datetime "created_at"
373
+ end
374
+
375
+ add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id"
376
+ add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context"
377
+
378
+ create_table "tags", :force => true do |t|
379
+ t.string "name"
380
+ end
381
+
382
+ create_table "tasks", :force => true do |t|
383
+ t.integer "user_id"
384
+ t.integer "assigned_to"
385
+ t.integer "completed_by"
386
+ t.string "name", :default => "", :null => false
387
+ t.integer "asset_id"
388
+ t.string "asset_type"
389
+ t.string "priority", :limit => 32
390
+ t.string "category", :limit => 32
391
+ t.string "bucket", :limit => 32
392
+ t.datetime "due_at"
393
+ t.datetime "completed_at"
394
+ t.datetime "deleted_at"
395
+ t.datetime "created_at", :null => false
396
+ t.datetime "updated_at", :null => false
397
+ t.string "background_info"
398
+ t.text "subscribed_users"
399
+ end
400
+
401
+ add_index "tasks", ["assigned_to"], :name => "index_tasks_on_assigned_to"
402
+ add_index "tasks", ["user_id", "name", "deleted_at"], :name => "index_tasks_on_user_id_and_name_and_deleted_at", :unique => true
403
+
404
+ create_table "users", :force => true do |t|
405
+ t.string "username", :limit => 32, :default => "", :null => false
406
+ t.string "email", :limit => 64, :default => "", :null => false
407
+ t.string "first_name", :limit => 32
408
+ t.string "last_name", :limit => 32
409
+ t.string "title", :limit => 64
410
+ t.string "company", :limit => 64
411
+ t.string "alt_email", :limit => 64
412
+ t.string "phone", :limit => 32
413
+ t.string "mobile", :limit => 32
414
+ t.string "aim", :limit => 32
415
+ t.string "yahoo", :limit => 32
416
+ t.string "google", :limit => 32
417
+ t.string "skype", :limit => 32
418
+ t.string "password_hash", :default => "", :null => false
419
+ t.string "password_salt", :default => "", :null => false
420
+ t.string "persistence_token", :default => "", :null => false
421
+ t.string "perishable_token", :default => "", :null => false
422
+ t.datetime "last_request_at"
423
+ t.datetime "last_login_at"
424
+ t.datetime "current_login_at"
425
+ t.string "last_login_ip"
426
+ t.string "current_login_ip"
427
+ t.integer "login_count", :default => 0, :null => false
428
+ t.datetime "deleted_at"
429
+ t.datetime "created_at", :null => false
430
+ t.datetime "updated_at", :null => false
431
+ t.boolean "admin", :default => false, :null => false
432
+ t.datetime "suspended_at"
433
+ t.string "single_access_token"
434
+ end
435
+
436
+ add_index "users", ["email"], :name => "index_users_on_email"
437
+ add_index "users", ["last_request_at"], :name => "index_users_on_last_request_at"
438
+ add_index "users", ["perishable_token"], :name => "index_users_on_perishable_token"
439
+ add_index "users", ["persistence_token"], :name => "index_users_on_remember_token"
440
+ add_index "users", ["username", "deleted_at"], :name => "index_users_on_username_and_deleted_at", :unique => true
441
+
442
+ create_table "versions", :force => true do |t|
443
+ t.string "item_type", :null => false
444
+ t.integer "item_id", :null => false
445
+ t.string "event", :limit => 512, :null => false
446
+ t.string "whodunnit"
447
+ t.text "object"
448
+ t.datetime "created_at"
449
+ t.text "object_changes"
450
+ t.integer "related_id"
451
+ t.string "related_type"
452
+ end
453
+
454
+ add_index "versions", ["item_type", "item_id"], :name => "index_versions_on_item_type_and_item_id"
455
+ add_index "versions", ["whodunnit"], :name => "index_versions_on_whodunnit"
456
+
457
+ end