transactionata 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +10 -0
- data/Gemfile +4 -0
- data/LICENSE +20 -0
- data/README.rdoc +62 -0
- data/Rakefile +33 -0
- data/lib/transactionata/version.rb +3 -0
- data/lib/transactionata.rb +38 -0
- data/test/helper.rb +9 -0
- data/test/rails2/Gemfile +14 -0
- data/test/rails2/Rakefile +10 -0
- data/test/rails2/app/controllers/application_controller.rb +3 -0
- data/test/rails2/app/controllers/posts_controller.rb +83 -0
- data/test/rails2/app/controllers/users_controller.rb +83 -0
- data/test/rails2/app/helpers/application_helper.rb +3 -0
- data/test/rails2/app/helpers/posts_helper.rb +2 -0
- data/test/rails2/app/helpers/users_helper.rb +2 -0
- data/test/rails2/app/models/post.rb +6 -0
- data/test/rails2/app/models/user.rb +9 -0
- data/test/rails2/app/views/layouts/application.html.erb +14 -0
- data/test/rails2/app/views/layouts/posts.html.erb +17 -0
- data/test/rails2/app/views/layouts/users.html.erb +17 -0
- data/test/rails2/app/views/posts/edit.html.erb +24 -0
- data/test/rails2/app/views/posts/index.html.erb +24 -0
- data/test/rails2/app/views/posts/new.html.erb +23 -0
- data/test/rails2/app/views/posts/show.html.erb +18 -0
- data/test/rails2/app/views/users/edit.html.erb +28 -0
- data/test/rails2/app/views/users/index.html.erb +26 -0
- data/test/rails2/app/views/users/new.html.erb +27 -0
- data/test/rails2/app/views/users/show.html.erb +23 -0
- data/test/rails2/config/boot.rb +128 -0
- data/test/rails2/config/database.yml +22 -0
- data/test/rails2/config/environment.rb +38 -0
- data/test/rails2/config/environments/development.rb +17 -0
- data/test/rails2/config/environments/production.rb +28 -0
- data/test/rails2/config/environments/test.rb +28 -0
- data/test/rails2/config/initializers/cookie_verification_secret.rb +7 -0
- data/test/rails2/config/initializers/new_rails_defaults.rb +21 -0
- data/test/rails2/config/initializers/session_store.rb +15 -0
- data/test/rails2/config/locales/en.yml +5 -0
- data/test/rails2/config/preinitializer.rb +20 -0
- data/test/rails2/config/routes.rb +49 -0
- data/test/rails2/db/migrate/20110214150055_create_posts.rb +15 -0
- data/test/rails2/db/migrate/20110214150128_create_users.rb +16 -0
- data/test/rails2/script/about +4 -0
- data/test/rails2/script/console +3 -0
- data/test/rails2/script/dbconsole +3 -0
- data/test/rails2/script/destroy +3 -0
- data/test/rails2/script/generate +3 -0
- data/test/rails2/script/performance/benchmarker +3 -0
- data/test/rails2/script/performance/profiler +3 -0
- data/test/rails2/script/plugin +3 -0
- data/test/rails2/script/runner +3 -0
- data/test/rails2/script/server +3 -0
- data/test/rails2/test/factories/posts_factory.rb +4 -0
- data/test/rails2/test/factories/users_factory.rb +7 -0
- data/test/rails2/test/fixtures/posts.yml +9 -0
- data/test/rails2/test/fixtures/users.yml +1 -0
- data/test/rails2/test/functional/posts_controller_test.rb +57 -0
- data/test/rails2/test/functional/users_controller_test.rb +57 -0
- data/test/rails2/test/integration/ui_test.rb +26 -0
- data/test/rails2/test/test_helper.rb +38 -0
- data/test/rails2/test/unit/helpers/posts_helper_test.rb +4 -0
- data/test/rails2/test/unit/helpers/users_helper_test.rb +4 -0
- data/test/rails2/test/unit/post_test.rb +42 -0
- data/test/rails2/test/unit/user_test.rb +32 -0
- data/test/rails3/Gemfile +37 -0
- data/test/rails3/Rakefile +7 -0
- data/test/rails3/app/controllers/application_controller.rb +3 -0
- data/test/rails3/app/controllers/posts_controller.rb +83 -0
- data/test/rails3/app/controllers/users_controller.rb +83 -0
- data/test/rails3/app/helpers/application_helper.rb +2 -0
- data/test/rails3/app/helpers/posts_helper.rb +2 -0
- data/test/rails3/app/helpers/users_helper.rb +2 -0
- data/test/rails3/app/models/post.rb +6 -0
- data/test/rails3/app/models/user.rb +9 -0
- data/test/rails3/app/views/layouts/application.html.erb +14 -0
- data/test/rails3/app/views/posts/_form.html.erb +25 -0
- data/test/rails3/app/views/posts/edit.html.erb +6 -0
- data/test/rails3/app/views/posts/index.html.erb +25 -0
- data/test/rails3/app/views/posts/new.html.erb +5 -0
- data/test/rails3/app/views/posts/show.html.erb +15 -0
- data/test/rails3/app/views/users/_form.html.erb +33 -0
- data/test/rails3/app/views/users/edit.html.erb +6 -0
- data/test/rails3/app/views/users/index.html.erb +29 -0
- data/test/rails3/app/views/users/new.html.erb +5 -0
- data/test/rails3/app/views/users/show.html.erb +25 -0
- data/test/rails3/config/application.rb +42 -0
- data/test/rails3/config/boot.rb +6 -0
- data/test/rails3/config/database.yml +22 -0
- data/test/rails3/config/environment.rb +5 -0
- data/test/rails3/config/environments/development.rb +26 -0
- data/test/rails3/config/environments/test.rb +35 -0
- data/test/rails3/config/initializers/secret_token.rb +7 -0
- data/test/rails3/config/initializers/session_store.rb +8 -0
- data/test/rails3/config/locales/en.yml +5 -0
- data/test/rails3/config/routes.rb +62 -0
- data/test/rails3/config.ru +4 -0
- data/test/rails3/db/.gitkeep +0 -0
- data/test/rails3/db/migrate/20110212112626_create_posts.rb +14 -0
- data/test/rails3/db/migrate/20110212120554_create_users.rb +16 -0
- data/test/rails3/db/migrate/20110213220543_add_user_reference_to_post.rb +9 -0
- data/test/rails3/script/rails +6 -0
- data/test/rails3/test/factories/posts_factory.rb +4 -0
- data/test/rails3/test/factories/users_factory.rb +7 -0
- data/test/rails3/test/fixtures/posts.yml +9 -0
- data/test/rails3/test/fixtures/users.yml +1 -0
- data/test/rails3/test/functional/posts_controller_test.rb +57 -0
- data/test/rails3/test/functional/users_controller_test.rb +57 -0
- data/test/rails3/test/integration/ui_test.rb +26 -0
- data/test/rails3/test/performance/browsing_test.rb +9 -0
- data/test/rails3/test/test_helper.rb +13 -0
- data/test/rails3/test/unit/helpers/posts_helper_test.rb +4 -0
- data/test/rails3/test/unit/helpers/users_helper_test.rb +4 -0
- data/test/rails3/test/unit/post_test.rb +42 -0
- data/test/rails3/test/unit/user_test.rb +32 -0
- data/test/test_rails2_integration.rb +26 -0
- data/test/test_rails3_integration.rb +26 -0
- data/transactionata.gemspec +24 -0
- metadata +316 -0
@@ -0,0 +1,33 @@
|
|
1
|
+
<%= form_for(@user) do |f| %>
|
2
|
+
<% if @user.errors.any? %>
|
3
|
+
<div id="error_explanation">
|
4
|
+
<h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>
|
5
|
+
|
6
|
+
<ul>
|
7
|
+
<% @user.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 :email %><br />
|
20
|
+
<%= f.text_field :email %>
|
21
|
+
</div>
|
22
|
+
<div class="field">
|
23
|
+
<%= f.label :login %><br />
|
24
|
+
<%= f.text_field :login %>
|
25
|
+
</div>
|
26
|
+
<div class="field">
|
27
|
+
<%= f.label :password %><br />
|
28
|
+
<%= f.text_field :password %>
|
29
|
+
</div>
|
30
|
+
<div class="actions">
|
31
|
+
<%= f.submit %>
|
32
|
+
</div>
|
33
|
+
<% end %>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<h1>Listing users</h1>
|
2
|
+
|
3
|
+
<table>
|
4
|
+
<tr>
|
5
|
+
<th>Name</th>
|
6
|
+
<th>Email</th>
|
7
|
+
<th>Login</th>
|
8
|
+
<th>Password</th>
|
9
|
+
<th></th>
|
10
|
+
<th></th>
|
11
|
+
<th></th>
|
12
|
+
</tr>
|
13
|
+
|
14
|
+
<% @users.each do |user| %>
|
15
|
+
<tr>
|
16
|
+
<td><%= user.name %></td>
|
17
|
+
<td><%= user.email %></td>
|
18
|
+
<td><%= user.login %></td>
|
19
|
+
<td><%= user.password %></td>
|
20
|
+
<td><%= link_to 'Show', user %></td>
|
21
|
+
<td><%= link_to 'Edit', edit_user_path(user) %></td>
|
22
|
+
<td><%= link_to 'Destroy', user, :confirm => 'Are you sure?', :method => :delete %></td>
|
23
|
+
</tr>
|
24
|
+
<% end %>
|
25
|
+
</table>
|
26
|
+
|
27
|
+
<br />
|
28
|
+
|
29
|
+
<%= link_to 'New User', new_user_path %>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
|
3
|
+
<p>
|
4
|
+
<b>Name:</b>
|
5
|
+
<%= @user.name %>
|
6
|
+
</p>
|
7
|
+
|
8
|
+
<p>
|
9
|
+
<b>Email:</b>
|
10
|
+
<%= @user.email %>
|
11
|
+
</p>
|
12
|
+
|
13
|
+
<p>
|
14
|
+
<b>Login:</b>
|
15
|
+
<%= @user.login %>
|
16
|
+
</p>
|
17
|
+
|
18
|
+
<p>
|
19
|
+
<b>Password:</b>
|
20
|
+
<%= @user.password %>
|
21
|
+
</p>
|
22
|
+
|
23
|
+
|
24
|
+
<%= link_to 'Edit', edit_user_path(@user) %> |
|
25
|
+
<%= link_to 'Back', users_path %>
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require 'rails/all'
|
4
|
+
|
5
|
+
# If you have a Gemfile, require the gems listed there, including any gems
|
6
|
+
# you've limited to :test, :development, or :production.
|
7
|
+
Bundler.require(:default, Rails.env) if defined?(Bundler)
|
8
|
+
|
9
|
+
module Rails3
|
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
|
+
# Custom directories with classes and modules you want to be autoloadable.
|
16
|
+
# config.autoload_paths += %W(#{config.root}/extras)
|
17
|
+
|
18
|
+
# Only load the plugins named here, in the order given (default is alphabetical).
|
19
|
+
# :all can be used as a placeholder for all plugins not explicitly named.
|
20
|
+
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
21
|
+
|
22
|
+
# Activate observers that should always be running.
|
23
|
+
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
24
|
+
|
25
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
26
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
27
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
28
|
+
|
29
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
30
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
31
|
+
# config.i18n.default_locale = :de
|
32
|
+
|
33
|
+
# JavaScript files you want as :defaults (application.js is always included).
|
34
|
+
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
|
35
|
+
|
36
|
+
# Configure the default encoding used in templates for Ruby 1.9.
|
37
|
+
config.encoding = "utf-8"
|
38
|
+
|
39
|
+
# Configure sensitive parameters which will be filtered from the log file.
|
40
|
+
config.filter_parameters += [:password]
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# SQLite version 3.x
|
2
|
+
# gem install sqlite3
|
3
|
+
development:
|
4
|
+
adapter: sqlite3
|
5
|
+
database: db/development.sqlite3
|
6
|
+
pool: 5
|
7
|
+
timeout: 5000
|
8
|
+
|
9
|
+
# Warning: The database defined as "test" will be erased and
|
10
|
+
# re-generated from your development database when you run "rake".
|
11
|
+
# Do not set this db to the same as development or production.
|
12
|
+
test:
|
13
|
+
adapter: sqlite3
|
14
|
+
database: db/test.sqlite3
|
15
|
+
pool: 5
|
16
|
+
timeout: 5000
|
17
|
+
|
18
|
+
production:
|
19
|
+
adapter: sqlite3
|
20
|
+
database: db/production.sqlite3
|
21
|
+
pool: 5
|
22
|
+
timeout: 5000
|
@@ -0,0 +1,26 @@
|
|
1
|
+
Rails3::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 webserver when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Log error messages when you accidentally call methods on nil.
|
10
|
+
config.whiny_nils = true
|
11
|
+
|
12
|
+
# Show full error reports and disable caching
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
config.action_view.debug_rjs = true
|
15
|
+
config.action_controller.perform_caching = false
|
16
|
+
|
17
|
+
# Don't care if the mailer can't send
|
18
|
+
config.action_mailer.raise_delivery_errors = false
|
19
|
+
|
20
|
+
# Print deprecation notices to the Rails logger
|
21
|
+
config.active_support.deprecation = :log
|
22
|
+
|
23
|
+
# Only use best-standards-support built into browsers
|
24
|
+
config.action_dispatch.best_standards_support = :builtin
|
25
|
+
end
|
26
|
+
|
@@ -0,0 +1,35 @@
|
|
1
|
+
Rails3::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# The test environment is used exclusively to run your application's
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
6
|
+
# your test database is "scratch space" for the test suite and is wiped
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
8
|
+
config.cache_classes = true
|
9
|
+
|
10
|
+
# Log error messages when you accidentally call methods on nil.
|
11
|
+
config.whiny_nils = true
|
12
|
+
|
13
|
+
# Show full error reports and disable caching
|
14
|
+
config.consider_all_requests_local = true
|
15
|
+
config.action_controller.perform_caching = false
|
16
|
+
|
17
|
+
# Raise exceptions instead of rendering exception templates
|
18
|
+
config.action_dispatch.show_exceptions = false
|
19
|
+
|
20
|
+
# Disable request forgery protection in test environment
|
21
|
+
config.action_controller.allow_forgery_protection = false
|
22
|
+
|
23
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
24
|
+
# The :test delivery method accumulates sent emails in the
|
25
|
+
# ActionMailer::Base.deliveries array.
|
26
|
+
config.action_mailer.delivery_method = :test
|
27
|
+
|
28
|
+
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
29
|
+
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
30
|
+
# like if you have constraints or database-specific column types
|
31
|
+
# config.active_record.schema_format = :sql
|
32
|
+
|
33
|
+
# Print deprecation notices to the stderr
|
34
|
+
config.active_support.deprecation = :stderr
|
35
|
+
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
|
+
Rails3::Application.config.secret_token = 'd5e83193433ffedd0060e01bc9bacfc249cb26263f7f224e0df372ce96f03c079cd148b87ea0ea4ed31e4b6f1e268a11e924bf539e32dd08f282529fea4c3f5e'
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
Rails3::Application.config.session_store :cookie_store, :key => '_rails3_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
|
+
# Rails3::Application.config.session_store :active_record_store
|
@@ -0,0 +1,62 @@
|
|
1
|
+
Rails3::Application.routes.draw do
|
2
|
+
resources :users
|
3
|
+
|
4
|
+
resources :posts
|
5
|
+
|
6
|
+
# The priority is based upon order of creation:
|
7
|
+
# first created -> highest priority.
|
8
|
+
|
9
|
+
# Sample of regular route:
|
10
|
+
# match 'products/:id' => 'catalog#view'
|
11
|
+
# Keep in mind you can assign values other than :controller and :action
|
12
|
+
|
13
|
+
# Sample of named route:
|
14
|
+
# match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
|
15
|
+
# This route can be invoked with purchase_url(:id => product.id)
|
16
|
+
|
17
|
+
# Sample resource route (maps HTTP verbs to controller actions automatically):
|
18
|
+
# resources :products
|
19
|
+
|
20
|
+
# Sample resource route with options:
|
21
|
+
# resources :products do
|
22
|
+
# member do
|
23
|
+
# get 'short'
|
24
|
+
# post 'toggle'
|
25
|
+
# end
|
26
|
+
#
|
27
|
+
# collection do
|
28
|
+
# get 'sold'
|
29
|
+
# end
|
30
|
+
# end
|
31
|
+
|
32
|
+
# Sample resource route with sub-resources:
|
33
|
+
# resources :products do
|
34
|
+
# resources :comments, :sales
|
35
|
+
# resource :seller
|
36
|
+
# end
|
37
|
+
|
38
|
+
# Sample resource route with more complex sub-resources
|
39
|
+
# resources :products do
|
40
|
+
# resources :comments
|
41
|
+
# resources :sales do
|
42
|
+
# get 'recent', :on => :collection
|
43
|
+
# end
|
44
|
+
# end
|
45
|
+
|
46
|
+
# Sample resource route within a namespace:
|
47
|
+
# namespace :admin do
|
48
|
+
# # Directs /admin/products/* to Admin::ProductsController
|
49
|
+
# # (app/controllers/admin/products_controller.rb)
|
50
|
+
# resources :products
|
51
|
+
# end
|
52
|
+
|
53
|
+
# You can have the root of your site routed with "root"
|
54
|
+
# just remember to delete public/index.html.
|
55
|
+
# root :to => "welcome#index"
|
56
|
+
|
57
|
+
# See how all your routes lay out with "rake routes"
|
58
|
+
|
59
|
+
# This is a legacy wild controller route that's not recommended for RESTful applications.
|
60
|
+
# Note: This route will make all actions in every controller accessible via GET requests.
|
61
|
+
# match ':controller(/:action(/:id(.:format)))'
|
62
|
+
end
|
File without changes
|
@@ -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'
|