Permalink
Browse files

Copied in the dummy_app from rails_admin, removed devise and papercli…

…p, added dummy_data, added a little bit of config to make it run better.
  • Loading branch information...
1 parent 4ed6794 commit 61b37389fb34564f19452d68d98ba905cebc92d6 @gunn committed Mar 29, 2011
Showing with 4,916 additions and 0 deletions.
  1. +5 −0 Gemfile
  2. +95 −0 Gemfile.lock
  3. +7 −0 Rakefile
  4. +3 −0 app/controllers/application_controller.rb
  5. +2 −0 app/helpers/application_helper.rb
  6. +8 −0 app/locales/models.en.yml
  7. +3 −0 app/models/comment.rb
  8. +7 −0 app/models/division.rb
  9. +11 −0 app/models/draft.rb
  10. +5 −0 app/models/fan.rb
  11. +2 −0 app/models/field_test.rb
  12. +6 −0 app/models/league.rb
  13. +11 −0 app/models/player.rb
  14. +6 −0 app/models/rel_test.rb
  15. +20 −0 app/models/team.rb
  16. +5 −0 app/models/user.rb
  17. +12 −0 app/views/layouts/application.html.erb
  18. +4 −0 config.ru
  19. +42 −0 config/application.rb
  20. +7 −0 config/boot.rb
  21. +22 −0 config/database.yml
  22. +5 −0 config/environment.rb
  23. +26 −0 config/environments/development.rb
  24. +49 −0 config/environments/production.rb
  25. +35 −0 config/environments/test.rb
  26. +7 −0 config/initializers/backtrace_silencers.rb
  27. +142 −0 config/initializers/devise.rb
  28. +1 −0 config/initializers/haml.rb
  29. +10 −0 config/initializers/inflections.rb
  30. +5 −0 config/initializers/mime_types.rb
  31. +12 −0 config/initializers/rails_admin.rb
  32. +7 −0 config/initializers/secret_token.rb
  33. +8 −0 config/initializers/session_store.rb
  34. +1 −0 config/locales
  35. +4 −0 config/routes.rb
  36. BIN db/development.sqlite3
  37. +13 −0 db/migrate/00000000000001_create_divisions_migration.rb
  38. +19 −0 db/migrate/00000000000002_create_drafts_migration.rb
  39. +12 −0 db/migrate/00000000000003_create_leagues_migration.rb
  40. +20 −0 db/migrate/00000000000004_create_players_migration.rb
  41. +22 −0 db/migrate/00000000000005_create_teams_migration.rb
  42. +23 −0 db/migrate/00000000000006_devise_create_users.rb
  43. +18 −0 db/migrate/00000000000007_create_histories_table.rb
  44. +12 −0 db/migrate/00000000000008_create_fans_migration.rb
  45. +11 −0 db/migrate/00000000000009_create_fans_teams_migration.rb
  46. +9 −0 db/migrate/00000000000010_add_revenue_to_team_migration.rb
  47. +9 −0 db/migrate/00000000000011_add_suspended_to_player_migration.rb
  48. +16 −0 db/migrate/00000000000012_add_avatar_columns_to_user.rb
  49. +9 −0 db/migrate/00000000000013_add_roles_to_user.rb
  50. +9 −0 db/migrate/00000000000014_add_color_to_team_migration.rb
  51. +15 −0 db/migrate/20101223222233_create_rel_tests.rb
  52. +15 −0 db/migrate/20110103205808_create_comments.rb
  53. +9 −0 db/migrate/20110123042530_rename_histories_to_rails_admin_histories.rb
  54. +22 −0 db/migrate/20110224184303_create_field_tests.rb
  55. +153 −0 db/schema.rb
  56. +21 −0 db/seeds.rb
  57. +13 −0 lib/tasks/dummy_data.rake
  58. +6 −0 script/rails
  59. +22 −0 test/dummy/Dummyfile
  60. +62 −0 test/dummy/data/divisions.yml
  61. +1,442 −0 test/dummy/data/drafts.yml
  62. +22 −0 test/dummy/data/fans.yml
  63. +112 −0 test/dummy/data/field_tests.yml
  64. +22 −0 test/dummy/data/leagues.yml
  65. +802 −0 test/dummy/data/players.yml
  66. +642 −0 test/dummy/data/rel_tests.yml
  67. +562 −0 test/dummy/data/teams.yml
  68. +132 −0 test/dummy/data/users.yml
  69. +32 −0 test/performance/rendering_test.rb
  70. +13 −0 test/test_helper.rb
View
@@ -0,0 +1,5 @@
+source :rubygems
+
+gem "rails_admin", :git => "git://github.com/gunn/rails_admin.git", :branch => "activo"
+gem "sqlite3"
+gem "dummy_data"
View
@@ -0,0 +1,95 @@
+GIT
+ remote: git://github.com/gunn/rails_admin.git
+ revision: 05c8edf7c4d07353bcf310c6509c931a8ff6dfe7
+ branch: activo
+ specs:
+ rails_admin (0.0.2)
+ builder (~> 2.1.0)
+ haml (~> 3.0.0)
+ haml-rails (~> 0.3.4)
+ rails (~> 3.0.3)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ abstract (1.0.0)
+ actionmailer (3.0.5)
+ actionpack (= 3.0.5)
+ mail (~> 2.2.15)
+ actionpack (3.0.5)
+ activemodel (= 3.0.5)
+ activesupport (= 3.0.5)
+ builder (~> 2.1.2)
+ erubis (~> 2.6.6)
+ i18n (~> 0.4)
+ rack (~> 1.2.1)
+ rack-mount (~> 0.6.13)
+ rack-test (~> 0.5.7)
+ tzinfo (~> 0.3.23)
+ activemodel (3.0.5)
+ activesupport (= 3.0.5)
+ builder (~> 2.1.2)
+ i18n (~> 0.4)
+ activerecord (3.0.5)
+ activemodel (= 3.0.5)
+ activesupport (= 3.0.5)
+ arel (~> 2.0.2)
+ tzinfo (~> 0.3.23)
+ activeresource (3.0.5)
+ activemodel (= 3.0.5)
+ activesupport (= 3.0.5)
+ activesupport (3.0.5)
+ arel (2.0.9)
+ builder (2.1.2)
+ dummy (0.9.1)
+ dummy_data (0.9.1)
+ dummy (>= 0.9.1)
+ rails (>= 3.0.0)
+ erubis (2.6.6)
+ abstract (>= 1.0.0)
+ haml (3.0.25)
+ haml-rails (0.3.4)
+ actionpack (~> 3.0)
+ activesupport (~> 3.0)
+ haml (~> 3.0)
+ railties (~> 3.0)
+ i18n (0.5.0)
+ mail (2.2.15)
+ activesupport (>= 2.3.6)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.16)
+ polyglot (0.3.1)
+ rack (1.2.2)
+ rack-mount (0.6.14)
+ rack (>= 1.0.0)
+ rack-test (0.5.7)
+ rack (>= 1.0)
+ rails (3.0.5)
+ actionmailer (= 3.0.5)
+ actionpack (= 3.0.5)
+ activerecord (= 3.0.5)
+ activeresource (= 3.0.5)
+ activesupport (= 3.0.5)
+ bundler (~> 1.0)
+ railties (= 3.0.5)
+ railties (3.0.5)
+ actionpack (= 3.0.5)
+ activesupport (= 3.0.5)
+ rake (>= 0.8.7)
+ thor (~> 0.14.4)
+ rake (0.8.7)
+ sqlite3 (1.3.3)
+ thor (0.14.6)
+ treetop (1.4.9)
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.25)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ dummy_data
+ rails_admin!
+ sqlite3
View
@@ -0,0 +1,7 @@
+# Add your own tasks in files placed in lib/tasks ending in .rake,
+# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+
+require File.expand_path('../config/application', __FILE__)
+require 'rake'
+
+Dummy::Application.load_tasks
@@ -0,0 +1,3 @@
+class ApplicationController < ActionController::Base
+ protect_from_forgery
+end
@@ -0,0 +1,2 @@
+module ApplicationHelper
+end
@@ -0,0 +1,8 @@
+en:
+ activerecord:
+ attributes:
+ fan:
+ name: His Name
+ team:
+ manager: Team Manager
+ fans: Some Fans
View
@@ -0,0 +1,3 @@
+class Comment < ActiveRecord::Base
+ belongs_to :commentable, :polymorphic => true
+end
View
@@ -0,0 +1,7 @@
+class Division < ActiveRecord::Base
+ validates_numericality_of(:league_id, :only_integer => true)
+ validates_presence_of(:name)
+
+ belongs_to(:league)
+ has_many(:teams)
+end
View
@@ -0,0 +1,11 @@
+class Draft < ActiveRecord::Base
+ validates_numericality_of(:player_id, :only_integer => true)
+ validates_numericality_of(:team_id, :only_integer => true)
+ validates_presence_of(:date)
+ validates_numericality_of(:round, :only_integer => true)
+ validates_numericality_of(:pick, :only_integer => true)
+ validates_numericality_of(:overall, :only_integer => true)
+
+ belongs_to(:team)
+ belongs_to(:player)
+end
View
@@ -0,0 +1,5 @@
+class Fan < ActiveRecord::Base
+ validates_presence_of(:name)
+ belongs_to :fanable, :polymorphic => true
+ has_and_belongs_to_many :teams
+end
View
@@ -0,0 +1,2 @@
+class FieldTest < ActiveRecord::Base
+end
View
@@ -0,0 +1,6 @@
+class League < ActiveRecord::Base
+ validates_presence_of(:name)
+
+ has_many(:divisions)
+ has_many(:teams)
+end
View
@@ -0,0 +1,11 @@
+class Player < ActiveRecord::Base
+ validates_presence_of(:name)
+ validates_numericality_of(:number, :only_integer => true)
+ validates_uniqueness_of(:number, :scope => :team_id, :message => "There is already a player with that number on this team")
+
+ belongs_to(:team)
+ has_one(:draft)
+ has_many :comments, :as => :commentable
+
+ attr_protected :suspended
+end
View
@@ -0,0 +1,6 @@
+class RelTest < ActiveRecord::Base
+ validates_numericality_of(:player_id, :only_integer => true)
+ belongs_to :league
+ belongs_to :division
+ belongs_to :player
+end
View
@@ -0,0 +1,20 @@
+class Team < ActiveRecord::Base
+ validates_numericality_of(:league_id, :only_integer => true)
+ validates_numericality_of(:division_id, :only_integer => true)
+ validates_presence_of(:manager)
+ validates_numericality_of(:founded, :only_integer => true)
+ validates_numericality_of(:wins, :only_integer => true)
+ validates_numericality_of(:losses, :only_integer => true)
+ validates_numericality_of(:win_percentage)
+ validates_numericality_of(:revenue, :allow_nil => true)
+
+ belongs_to(:league)
+ belongs_to(:division)
+ has_many(:players)
+ has_and_belongs_to_many :fans
+ has_many :comments, :as => :commentable
+
+ def player_names_truncated
+ players.map{|p| p.name}.join(", ")[0..32]
+ end
+end
View
@@ -0,0 +1,5 @@
+class User < ActiveRecord::Base
+ attr_accessible :email, :password, :password_confirmation, :remember_me
+
+ # serialize :roles, Array
+end
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Error</title>
+</head>
+<body>
+<h1 id="app_layout_warning">If you see this it means that there's a bug in rails_admin which is causing rails_admin's pages to be rendered with the application's layout.</h1>
+
+<%= yield %>
+
+</body>
+</html>
View
@@ -0,0 +1,4 @@
+# This file is used by Rack-based servers to start the application.
+
+require ::File.expand_path('../config/environment', __FILE__)
+run Dummy::Application
View
@@ -0,0 +1,42 @@
+require File.expand_path('../boot', __FILE__)
+
+require 'rails/all'
+
+# If you have a Gemfile, require the gems listed there, including any gems
+# you've limited to :test, :development, or :production.
+Bundler.require(:default, Rails.env) if defined?(Bundler)
+
+module Dummy
+ class Application < Rails::Application
+ # Settings in config/environments/* take precedence over those specified here.
+ # Application configuration should go into files in config/initializers
+ # -- all .rb files in that directory are automatically loaded.
+
+ # Custom directories with classes and modules you want to be autoloadable.
+ # config.autoload_paths += %W(#{config.root}/extras)
+
+ # Only load the plugins named here, in the order given (default is alphabetical).
+ # :all can be used as a placeholder for all plugins not explicitly named.
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
+
+ # Activate observers that should always be running.
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
+
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
+ # config.time_zone = 'Central Time (US & Canada)'
+
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
+ config.i18n.load_path += Dir[Rails.root.join('app', 'locales', '*.{rb,yml}').to_s]
+ # config.i18n.default_locale = :de
+
+ # JavaScript files you want as :defaults (application.js is always included).
+ # config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
+
+ # Configure the default encoding used in templates for Ruby 1.9.
+ config.encoding = "utf-8"
+
+ # Configure sensitive parameters which will be filtered from the log file.
+ config.filter_parameters += [:password]
+ end
+end
View
@@ -0,0 +1,7 @@
+require 'rubygems'
+
+# Set up gems listed in the Gemfile.
+gemfile = File.expand_path('../../Gemfile', __FILE__)
+ENV['BUNDLE_GEMFILE'] = gemfile
+require 'bundler'
+Bundler.setup
View
@@ -0,0 +1,22 @@
+# SQLite version 3.x
+# gem install sqlite3-ruby (not necessary on OS X Leopard)
+development:
+ adapter: sqlite3
+ database: db/development.sqlite3
+ pool: 5
+ timeout: 5000
+
+# Warning: The database defined as "test" will be erased and
+# re-generated from your development database when you run "rake".
+# Do not set this db to the same as development or production.
+test:
+ adapter: sqlite3
+ database: ':memory:'
+ pool: 5
+ timeout: 5000
+
+production:
+ adapter: sqlite3
+ database: db/production.sqlite3
+ pool: 5
+ timeout: 5000
View
@@ -0,0 +1,5 @@
+# Load the rails application
+require File.expand_path('../application', __FILE__)
+
+# Initialize the rails application
+Dummy::Application.initialize!
@@ -0,0 +1,26 @@
+Dummy::Application.configure do
+ # Settings specified here will take precedence over those in config/environment.rb
+
+ # In the development environment your application's code is reloaded on
+ # every request. This slows down response time but is perfect for development
+ # since you don't have to restart the webserver when you make code changes.
+ config.cache_classes = false
+
+ # Log error messages when you accidentally call methods on nil.
+ config.whiny_nils = true
+
+ # Show full error reports and disable caching
+ config.consider_all_requests_local = true
+ config.action_view.debug_rjs = true
+ config.action_controller.perform_caching = false
+
+ # Don't care if the mailer can't send
+ config.action_mailer.raise_delivery_errors = false
+
+ # Print deprecation notices to the Rails logger
+ config.active_support.deprecation = :log
+
+ # Only use best-standards-support built into browsers
+ config.action_dispatch.best_standards_support = :builtin
+end
+
@@ -0,0 +1,49 @@
+Dummy::Application.configure do
+ # Settings specified here will take precedence over those in config/environment.rb
+
+ # The production environment is meant for finished, "live" apps.
+ # Code is not reloaded between requests
+ config.cache_classes = true
+
+ # Full error reports are disabled and caching is turned on
+ config.consider_all_requests_local = false
+ config.action_controller.perform_caching = true
+
+ # Specifies the header that your server uses for sending files
+ config.action_dispatch.x_sendfile_header = "X-Sendfile"
+
+ # For nginx:
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
+
+ # If you have no front-end server that supports something like X-Sendfile,
+ # just comment this out and Rails will serve the files
+
+ # See everything in the log (default is :info)
+ # config.log_level = :debug
+
+ # Use a different logger for distributed setups
+ # config.logger = SyslogLogger.new
+
+ # Use a different cache store in production
+ # config.cache_store = :mem_cache_store
+
+ # Disable Rails's static asset server
+ # In production, Apache or nginx will already do this
+ config.serve_static_assets = false
+
+ # Enable serving of images, stylesheets, and javascripts from an asset server
+ # config.action_controller.asset_host = "http://assets.example.com"
+
+ # Disable delivery errors, bad email addresses will be ignored
+ # config.action_mailer.raise_delivery_errors = false
+
+ # Enable threaded mode
+ # config.threadsafe!
+
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
+ # the I18n.default_locale when a translation can not be found)
+ config.i18n.fallbacks = true
+
+ # Send deprecation notices to registered listeners
+ config.active_support.deprecation = :notify
+end
Oops, something went wrong.

0 comments on commit 61b3738

Please sign in to comment.