dune-balanced-creditcard 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +20 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +13 -0
  5. data/CHANGELOG.md +5 -0
  6. data/Gemfile +6 -0
  7. data/LICENSE.txt +22 -0
  8. data/README.md +48 -0
  9. data/Rakefile +34 -0
  10. data/app/assets/images/dune/balanced/creditcard/.gitkeep +0 -0
  11. data/app/assets/javascripts/dune/balanced/creditcard/flash.js.coffee +15 -0
  12. data/app/assets/javascripts/dune/balanced/creditcard/payments.js.coffee.erb +86 -0
  13. data/app/assets/javascripts/dune-balanced-creditcard.js +1 -0
  14. data/app/assets/stylesheets/dune/balanced/creditcard/application.css +16 -0
  15. data/app/controllers/dune/balanced/creditcard/application_controller.rb +4 -0
  16. data/app/controllers/dune/balanced/creditcard/payments_controller.rb +84 -0
  17. data/app/models/dune/balanced/creditcard/payment.rb +94 -0
  18. data/app/models/dune/balanced/creditcard/transaction_additional_fee_calculator.rb +12 -0
  19. data/app/models/dune/balanced/creditcard/transaction_fee_calculator_base.rb +31 -0
  20. data/app/models/dune/balanced/creditcard/transaction_inclusive_fee_calculator.rb +13 -0
  21. data/app/views/dune/balanced/creditcard/.gitkeep +0 -0
  22. data/app/views/dune/balanced/creditcard/payments/new.html.slim +98 -0
  23. data/bin/rails +8 -0
  24. data/config/initializers/registration.rb +5 -0
  25. data/config/locales/en.yml +32 -0
  26. data/config/locales/simple_form.en.yml +12 -0
  27. data/config/routes.rb +5 -0
  28. data/dune-balanced-creditcard.gemspec +27 -0
  29. data/lib/dune/balanced/creditcard/engine.rb +9 -0
  30. data/lib/dune/balanced/creditcard/interface.rb +27 -0
  31. data/lib/dune/balanced/creditcard/version.rb +7 -0
  32. data/lib/dune/balanced/creditcard.rb +11 -0
  33. data/lib/float_extensions.rb +11 -0
  34. data/spec/controllers/neighborly/balanced/creditcard/payments_controller_spec.rb +199 -0
  35. data/spec/dummy/README.rdoc +28 -0
  36. data/spec/dummy/Rakefile +6 -0
  37. data/spec/dummy/app/assets/images/.keep +0 -0
  38. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  39. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  40. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  41. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  42. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  43. data/spec/dummy/app/mailers/.keep +0 -0
  44. data/spec/dummy/app/models/.keep +0 -0
  45. data/spec/dummy/app/models/concerns/.keep +0 -0
  46. data/spec/dummy/app/models/configuration.rb +9 -0
  47. data/spec/dummy/app/models/contribution.rb +32 -0
  48. data/spec/dummy/app/models/match.rb +31 -0
  49. data/spec/dummy/app/models/payment_engine.rb +5 -0
  50. data/spec/dummy/app/models/project.rb +9 -0
  51. data/spec/dummy/app/models/user.rb +2 -0
  52. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  53. data/spec/dummy/bin/bundle +3 -0
  54. data/spec/dummy/bin/rails +4 -0
  55. data/spec/dummy/bin/rake +4 -0
  56. data/spec/dummy/config/application.rb +24 -0
  57. data/spec/dummy/config/boot.rb +5 -0
  58. data/spec/dummy/config/database.yml +25 -0
  59. data/spec/dummy/config/environment.rb +5 -0
  60. data/spec/dummy/config/environments/development.rb +29 -0
  61. data/spec/dummy/config/environments/production.rb +80 -0
  62. data/spec/dummy/config/environments/test.rb +36 -0
  63. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  64. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  65. data/spec/dummy/config/initializers/inflections.rb +16 -0
  66. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  67. data/spec/dummy/config/initializers/secret_token.rb +12 -0
  68. data/spec/dummy/config/initializers/session_store.rb +3 -0
  69. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  70. data/spec/dummy/config/locales/en.yml +23 -0
  71. data/spec/dummy/config/routes.rb +8 -0
  72. data/spec/dummy/config.ru +4 -0
  73. data/spec/dummy/db/schema.rb +27 -0
  74. data/spec/dummy/db/test.sqlite3 +0 -0
  75. data/spec/dummy/lib/assets/.keep +0 -0
  76. data/spec/dummy/log/.keep +0 -0
  77. data/spec/dummy/public/404.html +58 -0
  78. data/spec/dummy/public/422.html +58 -0
  79. data/spec/dummy/public/500.html +57 -0
  80. data/spec/dummy/public/favicon.ico +0 -0
  81. data/spec/lib/neighborly/balanced/creditcard/interface_spec.rb +37 -0
  82. data/spec/models/neighborly/balanced/creditcard/payment_spec.rb +223 -0
  83. data/spec/models/neighborly/balanced/creditcard/transaction_additional_fee_calculator_spec.rb +38 -0
  84. data/spec/models/neighborly/balanced/creditcard/transaction_inclusive_fee_calculator_spec.rb +19 -0
  85. data/spec/spec_helper.rb +15 -0
  86. metadata +252 -0
@@ -0,0 +1,32 @@
1
+ en:
2
+ dune:
3
+ balanced:
4
+ creditcard:
5
+ payments:
6
+ debit:
7
+ contribution:
8
+ description: 'Contribution to %{project_name}'
9
+ match:
10
+ description: 'Match for %{project_name}'
11
+ new:
12
+ card:
13
+ title: 'Card Information'
14
+ billing:
15
+ title: 'Billing Information'
16
+ terms: 'By contributing, I agree with the %{link}.'
17
+ terms-link: 'Terms of Use'
18
+ confirm: 'Confirm payment'
19
+ proccessing: 'Processing...'
20
+ cards:
21
+ title: 'Stored Cards'
22
+ add_new_card: 'Add a new card'
23
+ card_ending_in: '%{brand} %{number}'
24
+ expiration: 'Expiration:'
25
+ errors:
26
+ invalid_card: 'Sorry, card error. Please review and try again.'
27
+ marketplace_uri: 'Balanced URI is incorrect, please contact support.'
28
+ card_tokenization_error: 'Sorry, card error. Please review and try again.'
29
+ balanced: 'Sorry, something went wrong on our end. Please try again.'
30
+ create:
31
+ errors:
32
+ default: "Sorry, something must've gone wrong. Please try again."
@@ -0,0 +1,12 @@
1
+ en:
2
+ simple_form:
3
+ labels:
4
+ payment:
5
+ card_number: 'Card Number'
6
+ security_code: 'CVC'
7
+ user:
8
+ name: 'Name (as it appears on card)'
9
+ address_street: 'Street Address'
10
+ address_city: 'City'
11
+ address_state: 'State'
12
+ address_zip_code: 'Zip Code'
data/config/routes.rb ADDED
@@ -0,0 +1,5 @@
1
+ Dune::Balanced::Creditcard::Engine.routes.draw do
2
+ resources :payments, only: %i(new create update)
3
+
4
+ resources :notifications, only: :create
5
+ end
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'dune/balanced/creditcard/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'dune-balanced-creditcard'
8
+ spec.version = Dune::Balanced::Creditcard::VERSION
9
+ spec.authors = ['Legrand Pierre']
10
+ spec.email = %w(legrand.work@gmail.com)
11
+ spec.summary = 'dune-investissement integration with Credit Card Balanced Payments.'
12
+ spec.description = 'Integration with Balanced Payments on dune-investissement specifically with Credit Cards.'
13
+ spec.homepage = 'https://github.com/FromUte/dune-balanced-creditcard'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_dependency 'dune-balanced', '~> 1.0'
22
+
23
+ spec.add_dependency 'rails', '~> 4.0'
24
+ spec.add_dependency 'slim', '~> 2.0'
25
+ spec.add_development_dependency 'rspec-rails', '~> 2.14'
26
+ spec.add_development_dependency 'sqlite3', '~> 1.3'
27
+ end
@@ -0,0 +1,9 @@
1
+ module Dune
2
+ module Balanced
3
+ module Creditcard
4
+ class Engine < ::Rails::Engine
5
+ isolate_namespace Dune::Balanced::Creditcard
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,27 @@
1
+ module Dune::Balanced::Creditcard
2
+ class Interface
3
+
4
+ def name
5
+ 'balanced-creditcard'
6
+ end
7
+
8
+ def payment_path(resource)
9
+ key = "#{ActiveModel::Naming.param_key(resource)}_id"
10
+ Dune::Balanced::Creditcard::Engine.
11
+ routes.url_helpers.new_payment_path(key => resource)
12
+ end
13
+
14
+ def account_path
15
+ false
16
+ end
17
+
18
+ def fee_calculator(value)
19
+ TransactionAdditionalFeeCalculator.new(value)
20
+ end
21
+
22
+ def payout_class
23
+ Dune::Balanced::Payout
24
+ end
25
+
26
+ end
27
+ end
@@ -0,0 +1,7 @@
1
+ module Dune
2
+ module Balanced
3
+ module Creditcard
4
+ VERSION = '1.0.0'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,11 @@
1
+ require "dune/balanced/creditcard/engine"
2
+ require "dune/balanced/creditcard/version"
3
+ require "dune/balanced/creditcard/interface"
4
+
5
+ module Dune
6
+ module Balanced
7
+ module Creditcard
8
+ # Your code goes here...
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ module FloatExtensions
2
+ refine Float do
3
+ def floor_with_two_decimal_places
4
+ (self * 100).floor / 100.0
5
+ end
6
+
7
+ def ceil_with_two_decimal_places
8
+ BigDecimal(to_s).ceil(2).to_f
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,199 @@
1
+ require 'spec_helper'
2
+
3
+ describe Dune::Balanced::Creditcard::PaymentsController do
4
+ routes { Dune::Balanced::Creditcard::Engine.routes }
5
+ let(:current_user) { double('User').as_null_object }
6
+ let(:debit) { double('::Balanced::Debit').as_null_object }
7
+
8
+ let(:customer) do
9
+ double('::Balanced::Customer',
10
+ cards: [],
11
+ href: '/qwertyuiop').as_null_object
12
+ end
13
+
14
+ let(:card) do
15
+ double('::Balanced::Card',
16
+ id: '443',
17
+ href: '/cards/443').as_null_object
18
+ end
19
+
20
+ before do
21
+ ::Balanced::Customer.stub(:find).and_return(customer)
22
+ ::Balanced::Customer.stub(:new).and_return(customer)
23
+ ::Balanced::Card.stub(:fetch).and_return(card)
24
+ allow_any_instance_of(Dune::Balanced::OrderProxy).to receive(:debit_from).and_return(debit)
25
+ controller.stub(:authenticate_user!)
26
+ controller.stub(:current_user).and_return(current_user)
27
+ Dune::Balanced::Creditcard::Payment.any_instance.stub(:meta).and_return({})
28
+ end
29
+
30
+ describe 'GET \'new\'' do
31
+ shared_examples_for '#new' do
32
+ it 'should fetch balanced customer' do
33
+ expect_any_instance_of(Dune::Balanced::Customer).to receive(:fetch).and_return(customer)
34
+ get :new, params
35
+ end
36
+
37
+ it 'should receive authenticate_user!' do
38
+ expect(controller).to receive(:authenticate_user!)
39
+ get :new, params
40
+ end
41
+ end
42
+
43
+ context 'when params is contribution_id' do
44
+ let(:params) do
45
+ { contribution_id: 42 }
46
+ end
47
+
48
+ it_should_behave_like '#new'
49
+ end
50
+
51
+ context 'when params is match_id' do
52
+ let(:params) do
53
+ { match_id: 42 }
54
+ end
55
+
56
+ it_should_behave_like '#new'
57
+ end
58
+ end
59
+
60
+ describe 'POST \'create\'' do
61
+ shared_examples_for '#create' do
62
+ let(:user) do
63
+ double('User', balanced_contributor: double('BalancedContributor',
64
+ uri: 'project-owner-href'))
65
+ end
66
+
67
+ let(:project) do
68
+ double('Project', permalink: 'thirty-three', user: user).as_null_object
69
+ end
70
+
71
+ let(:params) do
72
+ {
73
+ 'payment' => {
74
+ 'use_card' => '443',
75
+ resource_id_name => '42',
76
+ 'user' => {}
77
+ },
78
+ }
79
+ end
80
+
81
+ before do
82
+ resource.stub(:id).and_return(42)
83
+ resource.stub(:project).and_return(project)
84
+
85
+ Dune::Balanced::Creditcard::Payment.any_instance.stub(:project_owner_customer).
86
+ and_return(double('::Balanced::Customer', href: 'project-owner-href'))
87
+ end
88
+
89
+ it 'should receive authenticate_user!' do
90
+ expect(controller).to receive(:authenticate_user!)
91
+ post :create, params
92
+ end
93
+
94
+ it 'generates new payment with given params' do
95
+ Dune::Balanced::Creditcard::Payment.should_receive(:new).
96
+ with(anything, customer, an_instance_of(resource.class), params['payment']).
97
+ and_return(double('Payment').as_null_object)
98
+ post :create, params
99
+ end
100
+
101
+ it 'generates new payment with engine\'s name given' do
102
+ Dune::Balanced::Creditcard::Payment.should_receive(:new).
103
+ with('balanced-creditcard', anything, anything, anything).
104
+ and_return(double('Payment').as_null_object)
105
+ post :create, params
106
+ end
107
+
108
+ it 'checkouts payment of resource' do
109
+ Dune::Balanced::Creditcard::Payment.any_instance.should_receive(:checkout!)
110
+ post :create, params
111
+ end
112
+
113
+ describe 'insertion of card on customer account' do
114
+ let(:customer) { double('::Balanced::Customer').as_null_object }
115
+ let(:card) do
116
+ double('::Balanced::Card', id: params['payment']['use_card'])
117
+ end
118
+ before do
119
+ controller.stub(:customer).and_return(customer)
120
+ end
121
+
122
+ context 'customer doesn\'t have the given card' do
123
+ before do
124
+ customer.stub(:cards).and_return([])
125
+ end
126
+
127
+ it 'inserts to customer\'s card list' do
128
+ expect(card).to receive(:associate_to_customer).with(customer)
129
+ post :create, params
130
+ end
131
+ end
132
+
133
+ context 'customer already has the card' do
134
+ before do
135
+ customer.stub(:cards).and_return([card])
136
+ end
137
+
138
+ it 'skips insertion' do
139
+ expect(card).to_not receive(:associate_to_customer)
140
+ post :create, params
141
+ end
142
+ end
143
+ end
144
+
145
+ describe 'update customer' do
146
+ it 'update user attributes and balanced customer' do
147
+ expect_any_instance_of(Dune::Balanced::Customer).to receive(:update!)
148
+ post :create, params
149
+ end
150
+ end
151
+
152
+ context 'with successul checkout' do
153
+ before do
154
+ Dune::Balanced::Creditcard::Payment.any_instance.
155
+ stub(:successful?).
156
+ and_return(true)
157
+ end
158
+
159
+ it 'redirects to resource page' do
160
+ resource.class.stub(:find).with('42').and_return(resource)
161
+ post :create, params
162
+ expect(response).to redirect_to(resource_path)
163
+ end
164
+ end
165
+
166
+ context 'with unsuccessul checkout' do
167
+ before do
168
+ Dune::Balanced::Creditcard::Payment.any_instance.
169
+ stub(:successful?).
170
+ and_return(false)
171
+ end
172
+
173
+ it 'redirects to resource edit page' do
174
+ resource.class.stub(:find).with('42').and_return(resource)
175
+ post :create, params
176
+ expect(response).to redirect_to(edit_resource_path)
177
+ end
178
+ end
179
+ end
180
+
181
+ context 'when resource is Contribution' do
182
+ let(:resource) { Contribution.new }
183
+ let(:resource_id_name) { 'contribution_id' }
184
+ let(:resource_path) { '/projects/thirty-three/contributions/42' }
185
+ let(:edit_resource_path) { '/projects/thirty-three/contributions/42/edit' }
186
+
187
+ it_should_behave_like '#create'
188
+ end
189
+
190
+ context 'when resource is Projects::Match' do
191
+ let(:resource) { Match.new }
192
+ let(:resource_id_name) { 'match_id' }
193
+ let(:resource_path) { '/projects/thirty-three/matches/42' }
194
+ let(:edit_resource_path) { '/projects/thirty-three/matches/42/edit' }
195
+
196
+ it_should_behave_like '#create'
197
+ end
198
+ end
199
+ end
@@ -0,0 +1,28 @@
1
+ == README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
25
+
26
+
27
+ Please feel free to use a different markup language if you do not plan to run
28
+ <tt>rake doc:app</tt>.
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+
6
+ Dummy::Application.load_tasks
File without changes
@@ -0,0 +1,13 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -0,0 +1,13 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require_tree .
13
+ */
@@ -0,0 +1,5 @@
1
+ class ApplicationController < ActionController::Base
2
+ # Prevent CSRF attacks by raising an exception.
3
+ # For APIs, you may want to use :null_session instead.
4
+ protect_from_forgery with: :exception
5
+ end
File without changes
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
File without changes
File without changes
File without changes
@@ -0,0 +1,9 @@
1
+ class Configuration
2
+ def self.[](*); end
3
+
4
+ def self.fetch(*); end
5
+
6
+ def self.table_name(*)
7
+ 'configurations'
8
+ end
9
+ end
@@ -0,0 +1,32 @@
1
+ # Dummy class to be stubbed
2
+ class Contribution
3
+ extend ActiveModel::Naming
4
+
5
+ def self.find(*)
6
+ new
7
+ end
8
+
9
+ def self.find_by(*)
10
+ new
11
+ end
12
+
13
+ def cancel!(*); end
14
+ def confirm!(*); end
15
+ def update_attributes(*); end
16
+
17
+ def id(*)
18
+ 42
19
+ end
20
+
21
+ def value(*)
22
+ 50
23
+ end
24
+
25
+ def project
26
+ @project ||= Project.new
27
+ end
28
+
29
+ def user
30
+ @user ||= User.new
31
+ end
32
+ end
@@ -0,0 +1,31 @@
1
+ class Match
2
+ extend ActiveModel::Naming
3
+
4
+ def self.find(*)
5
+ new
6
+ end
7
+
8
+ def self.find_by(*)
9
+ new
10
+ end
11
+
12
+ def cancel!(*); end
13
+ def confirm!(*); end
14
+ def update_attributes(*); end
15
+
16
+ def id(*)
17
+ 42
18
+ end
19
+
20
+ def value(*)
21
+ 50
22
+ end
23
+
24
+ def project
25
+ @project ||= Project.new
26
+ end
27
+
28
+ def user
29
+ @user ||= User.new
30
+ end
31
+ end
@@ -0,0 +1,5 @@
1
+ # Dummy class to be stubbed
2
+ class PaymentEngine
3
+ def self.register(*); end
4
+ def self.create_payment_notification(*); end
5
+ end
@@ -0,0 +1,9 @@
1
+ class Project
2
+ def permalink(*)
3
+ 'forty-two'
4
+ end
5
+
6
+ def user
7
+ @user ||= User.new
8
+ end
9
+ end
@@ -0,0 +1,2 @@
1
+ class User < ActiveRecord::Base
2
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6
+ <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -0,0 +1,24 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ Bundler.require(*Rails.groups)
6
+ require 'dune/balanced/creditcard'
7
+ require 'slim'
8
+
9
+ module Dummy
10
+ class Application < Rails::Application
11
+ # Settings in config/environments/* take precedence over those specified here.
12
+ # Application configuration should go into files in config/initializers
13
+ # -- all .rb files in that directory are automatically loaded.
14
+
15
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
16
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
17
+ # config.time_zone = 'Central Time (US & Canada)'
18
+
19
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
20
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
21
+ # config.i18n.default_locale = :de
22
+ end
23
+ end
24
+
@@ -0,0 +1,5 @@
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
5
+ $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ development:
7
+ adapter: sqlite3
8
+ database: db/development.sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ # Warning: The database defined as "test" will be erased and
13
+ # re-generated from your development database when you run "rake".
14
+ # Do not set this db to the same as development or production.
15
+ test:
16
+ adapter: sqlite3
17
+ database: db/test.sqlite3
18
+ pool: 5
19
+ timeout: 5000
20
+
21
+ production:
22
+ adapter: sqlite3
23
+ database: db/production.sqlite3
24
+ pool: 5
25
+ timeout: 5000
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the Rails application.
5
+ Dummy::Application.initialize!
@@ -0,0 +1,29 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Do not eager load code on boot.
10
+ config.eager_load = false
11
+
12
+ # Show full error reports and disable caching.
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send.
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger.
20
+ config.active_support.deprecation = :log
21
+
22
+ # Raise an error on page load if there are pending migrations
23
+ config.active_record.migration_error = :page_load
24
+
25
+ # Debug mode disables concatenation and preprocessing of assets.
26
+ # This option may cause significant delays in view rendering with a large
27
+ # number of complex assets.
28
+ config.assets.debug = true
29
+ end