delivery_uncle 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/Rakefile +21 -0
- data/app/assets/javascripts/delivery_uncle/application.js +13 -0
- data/app/assets/stylesheets/delivery_uncle/application.css +15 -0
- data/app/controllers/delivery_uncle/application_controller.rb +3 -0
- data/app/controllers/delivery_uncle/email_requests_controller.rb +108 -0
- data/app/helpers/delivery_uncle/application_helper.rb +4 -0
- data/app/models/delivery_uncle/activity.rb +25 -0
- data/app/models/delivery_uncle/email_request.rb +23 -0
- data/app/services/delivery_uncle/deliver.rb +29 -0
- data/app/services/delivery_uncle/email_queue.rb +58 -0
- data/app/services/delivery_uncle/paginate.rb +35 -0
- data/app/views/delivery_uncle/email_requests/configure.html.erb +25 -0
- data/app/views/delivery_uncle/email_requests/index.html.erb +44 -0
- data/app/views/delivery_uncle/email_requests/show.html.erb +8 -0
- data/app/views/layouts/delivery_uncle/application.html.erb +14 -0
- data/app/workers/delivery_uncle/send_email_request.rb +29 -0
- data/config/routes.rb +13 -0
- data/lib/delivery_uncle/engine.rb +25 -0
- data/lib/delivery_uncle/version.rb +3 -0
- data/lib/delivery_uncle.rb +4 -0
- data/lib/generators/delivery_uncle/install/install_generator.rb +25 -0
- data/lib/generators/delivery_uncle/install/templates/create_table_activities.rb +18 -0
- data/lib/generators/delivery_uncle/install/templates/create_table_email_requests.rb +14 -0
- data/lib/tasks/delivery_uncle_tasks.rake +4 -0
- data/spec/dummy/README.rdoc +261 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/agent.rb +2 -0
- data/spec/dummy/app/models/coupon.rb +2 -0
- data/spec/dummy/app/models/customer.rb +6 -0
- data/spec/dummy/app/models/denormalized_booking.rb +2 -0
- data/spec/dummy/app/models/departure.rb +3 -0
- data/spec/dummy/app/models/destination.rb +2 -0
- data/spec/dummy/app/models/discount.rb +3 -0
- data/spec/dummy/app/models/line_item.rb +5 -0
- data/spec/dummy/app/models/order.rb +7 -0
- data/spec/dummy/app/models/tour.rb +4 -0
- data/spec/dummy/app/models/tour_destination_assignment.rb +6 -0
- data/spec/dummy/app/models/tour_participant.rb +5 -0
- data/spec/dummy/app/models/tour_reservation.rb +6 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config/application.rb +59 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +37 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20140723105014_create_table_email_requests.rb +14 -0
- data/spec/dummy/db/migrate/20140723105015_create_table_activities.rb +18 -0
- data/spec/dummy/db/schema.rb +59 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +5 -0
- data/spec/dummy/log/test.log +34479 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/dummy/tmp/pids/redis-test.pid +1 -0
- data/spec/services/delivery_uncle/deliver_spec.rb +32 -0
- data/spec/services/delivery_uncle/email_queue_spec.rb +60 -0
- data/spec/services/delivery_uncle/paginate_spec.rb +54 -0
- data/spec/spec_helper.rb +45 -0
- 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,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
|
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
|