delivery_uncle 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +21 -0
  4. data/app/assets/javascripts/delivery_uncle/application.js +13 -0
  5. data/app/assets/stylesheets/delivery_uncle/application.css +15 -0
  6. data/app/controllers/delivery_uncle/application_controller.rb +3 -0
  7. data/app/controllers/delivery_uncle/email_requests_controller.rb +108 -0
  8. data/app/helpers/delivery_uncle/application_helper.rb +4 -0
  9. data/app/models/delivery_uncle/activity.rb +25 -0
  10. data/app/models/delivery_uncle/email_request.rb +23 -0
  11. data/app/services/delivery_uncle/deliver.rb +29 -0
  12. data/app/services/delivery_uncle/email_queue.rb +58 -0
  13. data/app/services/delivery_uncle/paginate.rb +35 -0
  14. data/app/views/delivery_uncle/email_requests/configure.html.erb +25 -0
  15. data/app/views/delivery_uncle/email_requests/index.html.erb +44 -0
  16. data/app/views/delivery_uncle/email_requests/show.html.erb +8 -0
  17. data/app/views/layouts/delivery_uncle/application.html.erb +14 -0
  18. data/app/workers/delivery_uncle/send_email_request.rb +29 -0
  19. data/config/routes.rb +13 -0
  20. data/lib/delivery_uncle/engine.rb +25 -0
  21. data/lib/delivery_uncle/version.rb +3 -0
  22. data/lib/delivery_uncle.rb +4 -0
  23. data/lib/generators/delivery_uncle/install/install_generator.rb +25 -0
  24. data/lib/generators/delivery_uncle/install/templates/create_table_activities.rb +18 -0
  25. data/lib/generators/delivery_uncle/install/templates/create_table_email_requests.rb +14 -0
  26. data/lib/tasks/delivery_uncle_tasks.rake +4 -0
  27. data/spec/dummy/README.rdoc +261 -0
  28. data/spec/dummy/Rakefile +7 -0
  29. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  30. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  31. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  32. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  33. data/spec/dummy/app/models/agent.rb +2 -0
  34. data/spec/dummy/app/models/coupon.rb +2 -0
  35. data/spec/dummy/app/models/customer.rb +6 -0
  36. data/spec/dummy/app/models/denormalized_booking.rb +2 -0
  37. data/spec/dummy/app/models/departure.rb +3 -0
  38. data/spec/dummy/app/models/destination.rb +2 -0
  39. data/spec/dummy/app/models/discount.rb +3 -0
  40. data/spec/dummy/app/models/line_item.rb +5 -0
  41. data/spec/dummy/app/models/order.rb +7 -0
  42. data/spec/dummy/app/models/tour.rb +4 -0
  43. data/spec/dummy/app/models/tour_destination_assignment.rb +6 -0
  44. data/spec/dummy/app/models/tour_participant.rb +5 -0
  45. data/spec/dummy/app/models/tour_reservation.rb +6 -0
  46. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  47. data/spec/dummy/config/application.rb +59 -0
  48. data/spec/dummy/config/boot.rb +10 -0
  49. data/spec/dummy/config/database.yml +25 -0
  50. data/spec/dummy/config/environment.rb +5 -0
  51. data/spec/dummy/config/environments/development.rb +37 -0
  52. data/spec/dummy/config/environments/production.rb +67 -0
  53. data/spec/dummy/config/environments/test.rb +37 -0
  54. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  55. data/spec/dummy/config/initializers/inflections.rb +15 -0
  56. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  57. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  58. data/spec/dummy/config/initializers/session_store.rb +8 -0
  59. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  60. data/spec/dummy/config/locales/en.yml +5 -0
  61. data/spec/dummy/config/routes.rb +3 -0
  62. data/spec/dummy/config.ru +4 -0
  63. data/spec/dummy/db/development.sqlite3 +0 -0
  64. data/spec/dummy/db/migrate/20140723105014_create_table_email_requests.rb +14 -0
  65. data/spec/dummy/db/migrate/20140723105015_create_table_activities.rb +18 -0
  66. data/spec/dummy/db/schema.rb +59 -0
  67. data/spec/dummy/db/test.sqlite3 +0 -0
  68. data/spec/dummy/log/development.log +5 -0
  69. data/spec/dummy/log/test.log +34479 -0
  70. data/spec/dummy/public/404.html +26 -0
  71. data/spec/dummy/public/422.html +26 -0
  72. data/spec/dummy/public/500.html +25 -0
  73. data/spec/dummy/public/favicon.ico +0 -0
  74. data/spec/dummy/script/rails +6 -0
  75. data/spec/dummy/tmp/pids/redis-test.pid +1 -0
  76. data/spec/services/delivery_uncle/deliver_spec.rb +32 -0
  77. data/spec/services/delivery_uncle/email_queue_spec.rb +60 -0
  78. data/spec/services/delivery_uncle/paginate_spec.rb +54 -0
  79. data/spec/spec_helper.rb +45 -0
  80. metadata +245 -0
@@ -0,0 +1,15 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
11
+ #
12
+ # These inflection rules are supported but not enabled by default:
13
+ # ActiveSupport::Inflector.inflections do |inflect|
14
+ # inflect.acronym 'RESTful'
15
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ Dummy::Application.config.secret_token = 'c55358f5f7aad166235e0933098b02a15cdb2cd7ac171529bd132b349905134495f2ddd32c6a63aeb5655608aa8973878f97b8d0157ac4f19de46ed55d348c31'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # Dummy::Application.config.session_store :active_record_store
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json]
9
+ end
10
+
11
+ # Disable root element in JSON by default.
12
+ ActiveSupport.on_load(:active_record) do
13
+ self.include_root_in_json = false
14
+ end
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,3 @@
1
+ Rails.application.routes.draw do
2
+
3
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application
Binary file
@@ -0,0 +1,14 @@
1
+ class CreateTableEmailRequests < ActiveRecord::Migration
2
+ def change
3
+ create_table :delivery_uncle_email_requests do |t|
4
+ t.text :mail_body
5
+ t.string :mailer
6
+ t.string :mailer_method
7
+ t.string :mail_type
8
+ t.string :request_from
9
+ t.string :status
10
+
11
+ t.timestamps
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,18 @@
1
+ class CreateTableActivities < ActiveRecord::Migration
2
+ def change
3
+ create_table :delivery_uncle_activities do |t|
4
+ t.string :actor
5
+ t.text :actor_desc
6
+
7
+ t.string :verb
8
+ t.text :verb_desc
9
+
10
+ t.string :object_type
11
+ t.text :object_details
12
+
13
+ t.boolean :expired
14
+
15
+ t.timestamps
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,59 @@
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 => 0) do
15
+
16
+ create_table "denormalized_bookings", :force => true do |t|
17
+ t.integer "order_id"
18
+ t.string "order_reference"
19
+ t.string "status"
20
+ t.date "order_completed_at"
21
+ t.string "contact_name"
22
+ t.string "agent_name"
23
+ t.string "tour_code"
24
+ t.string "tour_name"
25
+ t.float "number_of_days"
26
+ t.string "private_scheduled"
27
+ t.date "departure_date"
28
+ t.integer "pax"
29
+ t.integer "pax_adult"
30
+ t.integer "pax_child"
31
+ t.string "nationality"
32
+ t.string "lead_source"
33
+ t.string "lead_source_details"
34
+ t.decimal "value_thb", :precision => 12, :scale => 2, :default => 0.0, :null => false
35
+ t.date "deposit_paid_date"
36
+ t.date "paid_date"
37
+ t.date "last_update"
38
+ t.datetime "created_at"
39
+ t.datetime "updated_at"
40
+ t.decimal "value_usd", :precision => 12, :scale => 2, :default => 0.0, :null => false
41
+ t.string "contact_email"
42
+ t.decimal "deposit_amount_thb", :precision => 12, :scale => 2, :default => 0.0, :null => false
43
+ t.decimal "additional_payments_amount_thb", :precision => 12, :scale => 2, :default => 0.0, :null => false
44
+ t.decimal "balance_amount_thb", :precision => 12, :scale => 2, :default => 0.0, :null => false
45
+ t.decimal "single_supplement_thb", :precision => 12, :scale => 2, :default => 0.0, :null => false
46
+ t.decimal "bike_hire_thb", :precision => 12, :scale => 2, :default => 0.0, :null => false
47
+ t.decimal "tour_cost_thb", :precision => 12, :scale => 2, :default => 0.0, :null => false
48
+ t.date "last_additional_payment_date"
49
+ t.date "balance_due_date"
50
+ t.string "primary_destination"
51
+ t.string "customer_name"
52
+ t.string "customer_category"
53
+ t.string "quote_number"
54
+ t.string "currency"
55
+ t.decimal "balance", :precision => 10, :scale => 0
56
+ t.decimal "total", :precision => 10, :scale => 0
57
+ end
58
+
59
+ end
Binary file
@@ -0,0 +1,5 @@
1
+ Connecting to database specified by database.yml
2
+ Connecting to database specified by database.yml
3
+ Connecting to database specified by database.yml
4
+ Connecting to database specified by database.yml
5
+ Connecting to database specified by database.yml