disable_connection_pooling 0.0.1 → 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.
- checksums.yaml +4 -4
- data/.gitignore +6 -0
- data/README.md +7 -2
- data/disable_connection_pooling.gemspec +2 -1
- data/lib/disable_connection_pooling/active_record_base.rb +2 -0
- data/lib/disable_connection_pooling/version.rb +1 -1
- data/spec/disable_connection_pooling_spec.rb +37 -0
- data/spec/rails/3.2/Gemfile +5 -0
- data/spec/rails/3.2/README.rdoc +261 -0
- data/spec/rails/3.2/Rakefile +7 -0
- data/spec/rails/3.2/app/assets/images/rails.png +0 -0
- data/spec/rails/3.2/app/assets/javascripts/application.js +13 -0
- data/spec/rails/3.2/app/assets/javascripts/items.js +2 -0
- data/spec/rails/3.2/app/assets/stylesheets/application.css +13 -0
- data/spec/rails/3.2/app/assets/stylesheets/items.css +4 -0
- data/spec/rails/3.2/app/assets/stylesheets/scaffold.css +56 -0
- data/spec/rails/3.2/app/controllers/application_controller.rb +3 -0
- data/spec/rails/3.2/app/controllers/items_controller.rb +83 -0
- data/spec/rails/3.2/app/helpers/application_helper.rb +2 -0
- data/spec/rails/3.2/app/helpers/items_helper.rb +2 -0
- data/spec/rails/3.2/app/mailers/.gitkeep +0 -0
- data/spec/rails/3.2/app/models/.gitkeep +0 -0
- data/spec/rails/3.2/app/models/item.rb +3 -0
- data/spec/rails/3.2/app/views/items/_form.html.erb +25 -0
- data/spec/rails/3.2/app/views/items/edit.html.erb +6 -0
- data/spec/rails/3.2/app/views/items/index.html.erb +25 -0
- data/spec/rails/3.2/app/views/items/new.html.erb +5 -0
- data/spec/rails/3.2/app/views/items/show.html.erb +15 -0
- data/spec/rails/3.2/app/views/layouts/application.html.erb +14 -0
- data/spec/rails/3.2/config.ru +4 -0
- data/spec/rails/3.2/config/application.rb +64 -0
- data/spec/rails/3.2/config/boot.rb +6 -0
- data/spec/rails/3.2/config/database.yml +9 -0
- data/spec/rails/3.2/config/environment.rb +5 -0
- data/spec/rails/3.2/config/environments/development.rb +32 -0
- data/spec/rails/3.2/config/environments/production.rb +54 -0
- data/spec/rails/3.2/config/environments/test.rb +37 -0
- data/spec/rails/3.2/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/rails/3.2/config/initializers/inflections.rb +15 -0
- data/spec/rails/3.2/config/initializers/mime_types.rb +5 -0
- data/spec/rails/3.2/config/initializers/secret_token.rb +7 -0
- data/spec/rails/3.2/config/initializers/session_store.rb +8 -0
- data/spec/rails/3.2/config/initializers/wrap_parameters.rb +14 -0
- data/spec/rails/3.2/config/locales/en.yml +5 -0
- data/spec/rails/3.2/config/routes.rb +61 -0
- data/spec/rails/3.2/db/migrate/20140214122413_create_items.rb +10 -0
- data/spec/rails/3.2/db/schema.rb +23 -0
- data/spec/rails/3.2/db/seeds.rb +7 -0
- data/spec/rails/3.2/lib/assets/.gitkeep +0 -0
- data/spec/rails/3.2/lib/tasks/.gitkeep +0 -0
- data/spec/rails/3.2/log/.gitkeep +0 -0
- data/spec/rails/3.2/public/404.html +26 -0
- data/spec/rails/3.2/public/422.html +26 -0
- data/spec/rails/3.2/public/500.html +25 -0
- data/spec/rails/3.2/public/favicon.ico +0 -0
- data/spec/rails/3.2/public/index.html +241 -0
- data/spec/rails/3.2/public/robots.txt +5 -0
- data/spec/rails/3.2/script/rails +6 -0
- data/spec/rails/3.2/vendor/assets/javascripts/.gitkeep +0 -0
- data/spec/rails/3.2/vendor/assets/stylesheets/.gitkeep +0 -0
- data/spec/rails/3.2/vendor/plugins/.gitkeep +0 -0
- data/spec/rails/4.0/Gemfile +6 -0
- data/spec/rails/4.0/README.rdoc +28 -0
- data/spec/rails/4.0/Rakefile +6 -0
- data/spec/rails/4.0/app/assets/images/.keep +0 -0
- data/spec/rails/4.0/app/assets/javascripts/application.js +13 -0
- data/spec/rails/4.0/app/assets/javascripts/items.js +2 -0
- data/spec/rails/4.0/app/assets/stylesheets/application.css +13 -0
- data/spec/rails/4.0/app/assets/stylesheets/items.css +4 -0
- data/spec/rails/4.0/app/assets/stylesheets/scaffold.css +56 -0
- data/spec/rails/4.0/app/controllers/application_controller.rb +5 -0
- data/spec/rails/4.0/app/controllers/concerns/.keep +0 -0
- data/spec/rails/4.0/app/controllers/items_controller.rb +74 -0
- data/spec/rails/4.0/app/helpers/application_helper.rb +2 -0
- data/spec/rails/4.0/app/helpers/items_helper.rb +2 -0
- data/spec/rails/4.0/app/mailers/.keep +0 -0
- data/spec/rails/4.0/app/models/.keep +0 -0
- data/spec/rails/4.0/app/models/concerns/.keep +0 -0
- data/spec/rails/4.0/app/models/item.rb +2 -0
- data/spec/rails/4.0/app/views/items/_form.html.erb +25 -0
- data/spec/rails/4.0/app/views/items/edit.html.erb +6 -0
- data/spec/rails/4.0/app/views/items/index.html.erb +29 -0
- data/spec/rails/4.0/app/views/items/index.json.jbuilder +4 -0
- data/spec/rails/4.0/app/views/items/new.html.erb +5 -0
- data/spec/rails/4.0/app/views/items/show.html.erb +14 -0
- data/spec/rails/4.0/app/views/items/show.json.jbuilder +1 -0
- data/spec/rails/4.0/app/views/layouts/application.html.erb +14 -0
- data/spec/rails/4.0/bin/bundle +3 -0
- data/spec/rails/4.0/bin/rails +4 -0
- data/spec/rails/4.0/bin/rake +4 -0
- data/spec/rails/4.0/config.ru +4 -0
- data/spec/rails/4.0/config/application.rb +33 -0
- data/spec/rails/4.0/config/boot.rb +4 -0
- data/spec/rails/4.0/config/database.yml +9 -0
- data/spec/rails/4.0/config/environment.rb +5 -0
- data/spec/rails/4.0/config/environments/development.rb +25 -0
- data/spec/rails/4.0/config/environments/production.rb +65 -0
- data/spec/rails/4.0/config/environments/test.rb +36 -0
- data/spec/rails/4.0/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/rails/4.0/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/rails/4.0/config/initializers/inflections.rb +16 -0
- data/spec/rails/4.0/config/initializers/mime_types.rb +5 -0
- data/spec/rails/4.0/config/initializers/secret_token.rb +12 -0
- data/spec/rails/4.0/config/initializers/session_store.rb +3 -0
- data/spec/rails/4.0/config/initializers/wrap_parameters.rb +14 -0
- data/spec/rails/4.0/config/locales/en.yml +23 -0
- data/spec/rails/4.0/config/routes.rb +58 -0
- data/spec/rails/4.0/db/migrate/20140214124018_create_items.rb +10 -0
- data/spec/rails/4.0/db/schema.rb +23 -0
- data/spec/rails/4.0/db/seeds.rb +7 -0
- data/spec/rails/4.0/lib/assets/.keep +0 -0
- data/spec/rails/4.0/lib/tasks/.keep +0 -0
- data/spec/rails/4.0/log/.keep +0 -0
- data/spec/rails/4.0/public/404.html +58 -0
- data/spec/rails/4.0/public/422.html +58 -0
- data/spec/rails/4.0/public/500.html +57 -0
- data/spec/rails/4.0/public/favicon.ico +0 -0
- data/spec/rails/4.0/public/robots.txt +5 -0
- data/spec/rails/4.0/vendor/assets/javascripts/.keep +0 -0
- data/spec/rails/4.0/vendor/assets/stylesheets/.keep +0 -0
- data/spec/spec_helper.rb +44 -0
- metadata +246 -5
- data/spec/dummy_spec.rb +0 -5
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
+
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
|
+
require 'rails/commands'
|
File without changes
|
File without changes
|
File without changes
|
@@ -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>.
|
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,56 @@
|
|
1
|
+
body { background-color: #fff; color: #333; }
|
2
|
+
|
3
|
+
body, p, ol, ul, td {
|
4
|
+
font-family: verdana, arial, helvetica, sans-serif;
|
5
|
+
font-size: 13px;
|
6
|
+
line-height: 18px;
|
7
|
+
}
|
8
|
+
|
9
|
+
pre {
|
10
|
+
background-color: #eee;
|
11
|
+
padding: 10px;
|
12
|
+
font-size: 11px;
|
13
|
+
}
|
14
|
+
|
15
|
+
a { color: #000; }
|
16
|
+
a:visited { color: #666; }
|
17
|
+
a:hover { color: #fff; background-color:#000; }
|
18
|
+
|
19
|
+
div.field, div.actions {
|
20
|
+
margin-bottom: 10px;
|
21
|
+
}
|
22
|
+
|
23
|
+
#notice {
|
24
|
+
color: green;
|
25
|
+
}
|
26
|
+
|
27
|
+
.field_with_errors {
|
28
|
+
padding: 2px;
|
29
|
+
background-color: red;
|
30
|
+
display: table;
|
31
|
+
}
|
32
|
+
|
33
|
+
#error_explanation {
|
34
|
+
width: 450px;
|
35
|
+
border: 2px solid red;
|
36
|
+
padding: 7px;
|
37
|
+
padding-bottom: 0;
|
38
|
+
margin-bottom: 20px;
|
39
|
+
background-color: #f0f0f0;
|
40
|
+
}
|
41
|
+
|
42
|
+
#error_explanation h2 {
|
43
|
+
text-align: left;
|
44
|
+
font-weight: bold;
|
45
|
+
padding: 5px 5px 5px 15px;
|
46
|
+
font-size: 12px;
|
47
|
+
margin: -7px;
|
48
|
+
margin-bottom: 0px;
|
49
|
+
background-color: #c00;
|
50
|
+
color: #fff;
|
51
|
+
}
|
52
|
+
|
53
|
+
#error_explanation ul li {
|
54
|
+
font-size: 12px;
|
55
|
+
list-style: square;
|
56
|
+
}
|
File without changes
|
@@ -0,0 +1,74 @@
|
|
1
|
+
class ItemsController < ApplicationController
|
2
|
+
before_action :set_item, only: [:show, :edit, :update, :destroy]
|
3
|
+
|
4
|
+
# GET /items
|
5
|
+
# GET /items.json
|
6
|
+
def index
|
7
|
+
@items = Item.all
|
8
|
+
end
|
9
|
+
|
10
|
+
# GET /items/1
|
11
|
+
# GET /items/1.json
|
12
|
+
def show
|
13
|
+
end
|
14
|
+
|
15
|
+
# GET /items/new
|
16
|
+
def new
|
17
|
+
@item = Item.new
|
18
|
+
end
|
19
|
+
|
20
|
+
# GET /items/1/edit
|
21
|
+
def edit
|
22
|
+
end
|
23
|
+
|
24
|
+
# POST /items
|
25
|
+
# POST /items.json
|
26
|
+
def create
|
27
|
+
@item = Item.new(item_params)
|
28
|
+
|
29
|
+
respond_to do |format|
|
30
|
+
if @item.save
|
31
|
+
format.html { redirect_to @item, notice: 'Item was successfully created.' }
|
32
|
+
format.json { render action: 'show', status: :created, location: @item }
|
33
|
+
else
|
34
|
+
format.html { render action: 'new' }
|
35
|
+
format.json { render json: @item.errors, status: :unprocessable_entity }
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
# PATCH/PUT /items/1
|
41
|
+
# PATCH/PUT /items/1.json
|
42
|
+
def update
|
43
|
+
respond_to do |format|
|
44
|
+
if @item.update(item_params)
|
45
|
+
format.html { redirect_to @item, notice: 'Item was successfully updated.' }
|
46
|
+
format.json { head :no_content }
|
47
|
+
else
|
48
|
+
format.html { render action: 'edit' }
|
49
|
+
format.json { render json: @item.errors, status: :unprocessable_entity }
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
# DELETE /items/1
|
55
|
+
# DELETE /items/1.json
|
56
|
+
def destroy
|
57
|
+
@item.destroy
|
58
|
+
respond_to do |format|
|
59
|
+
format.html { redirect_to items_url }
|
60
|
+
format.json { head :no_content }
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
private
|
65
|
+
# Use callbacks to share common setup or constraints between actions.
|
66
|
+
def set_item
|
67
|
+
@item = Item.find(params[:id])
|
68
|
+
end
|
69
|
+
|
70
|
+
# Never trust parameters from the scary internet, only allow the white list through.
|
71
|
+
def item_params
|
72
|
+
params.require(:item).permit(:name, :description)
|
73
|
+
end
|
74
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<%= form_for(@item) do |f| %>
|
2
|
+
<% if @item.errors.any? %>
|
3
|
+
<div id="error_explanation">
|
4
|
+
<h2><%= pluralize(@item.errors.count, "error") %> prohibited this item from being saved:</h2>
|
5
|
+
|
6
|
+
<ul>
|
7
|
+
<% @item.errors.full_messages.each do |msg| %>
|
8
|
+
<li><%= msg %></li>
|
9
|
+
<% end %>
|
10
|
+
</ul>
|
11
|
+
</div>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<div class="field">
|
15
|
+
<%= f.label :name %><br>
|
16
|
+
<%= f.text_field :name %>
|
17
|
+
</div>
|
18
|
+
<div class="field">
|
19
|
+
<%= f.label :description %><br>
|
20
|
+
<%= f.text_area :description %>
|
21
|
+
</div>
|
22
|
+
<div class="actions">
|
23
|
+
<%= f.submit %>
|
24
|
+
</div>
|
25
|
+
<% end %>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<h1>Listing items</h1>
|
2
|
+
|
3
|
+
<table>
|
4
|
+
<thead>
|
5
|
+
<tr>
|
6
|
+
<th>Name</th>
|
7
|
+
<th>Description</th>
|
8
|
+
<th></th>
|
9
|
+
<th></th>
|
10
|
+
<th></th>
|
11
|
+
</tr>
|
12
|
+
</thead>
|
13
|
+
|
14
|
+
<tbody>
|
15
|
+
<% @items.each do |item| %>
|
16
|
+
<tr>
|
17
|
+
<td><%= item.name %></td>
|
18
|
+
<td><%= item.description %></td>
|
19
|
+
<td><%= link_to 'Show', item %></td>
|
20
|
+
<td><%= link_to 'Edit', edit_item_path(item) %></td>
|
21
|
+
<td><%= link_to 'Destroy', item, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
22
|
+
</tr>
|
23
|
+
<% end %>
|
24
|
+
</tbody>
|
25
|
+
</table>
|
26
|
+
|
27
|
+
<br>
|
28
|
+
|
29
|
+
<%= link_to 'New Item', new_item_path %>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
|
3
|
+
<p>
|
4
|
+
<strong>Name:</strong>
|
5
|
+
<%= @item.name %>
|
6
|
+
</p>
|
7
|
+
|
8
|
+
<p>
|
9
|
+
<strong>Description:</strong>
|
10
|
+
<%= @item.description %>
|
11
|
+
</p>
|
12
|
+
|
13
|
+
<%= link_to 'Edit', edit_item_path(@item) %> |
|
14
|
+
<%= link_to 'Back', items_path %>
|
@@ -0,0 +1 @@
|
|
1
|
+
json.extract! @item, :id, :name, :description, :created_at, :updated_at
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
# Pick the frameworks you want:
|
4
|
+
require "active_record/railtie"
|
5
|
+
require "action_controller/railtie"
|
6
|
+
require "action_mailer/railtie"
|
7
|
+
# require "sprockets/railtie"
|
8
|
+
# require "rails/test_unit/railtie"
|
9
|
+
|
10
|
+
# Require the gems listed in Gemfile, including any gems
|
11
|
+
# you've limited to :test, :development, or :production.
|
12
|
+
Bundler.require(:default, Rails.env)
|
13
|
+
|
14
|
+
module Dummy
|
15
|
+
class Application < Rails::Application
|
16
|
+
# Settings in config/environments/* take precedence over those specified here.
|
17
|
+
# Application configuration should go into files in config/initializers
|
18
|
+
# -- all .rb files in that directory are automatically loaded.
|
19
|
+
|
20
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
21
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
22
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
23
|
+
|
24
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
25
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
26
|
+
# config.i18n.default_locale = :de
|
27
|
+
|
28
|
+
# Disable the asset pipeline.
|
29
|
+
config.assets.enabled = false
|
30
|
+
|
31
|
+
config.active_record.disable_connection_pooling = false
|
32
|
+
end
|
33
|
+
end
|