diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..9fbad92 --- /dev/null +++ b/Gemfile @@ -0,0 +1,35 @@ +source 'http://rubygems.org' + +gem 'rails', '3.0.0.beta3' + +# Bundle edge Rails instead: +# gem 'rails', :git => 'git://github.com/rails/rails.git' + +gem 'pg' +gem 'bundler' + +gem 'json' + +gem "machinist" +gem "faker" +gem "devise", "1.1.rc1" +gem "warden" +gem "declarative_authorization", :git => "http://github.com/stffn/declarative_authorization.git" + +# Use unicorn as the web server +# gem 'unicorn' + +# Deploy with Capistrano +# gem 'capistrano' + +# Bundle the extra gems: +# gem 'bj' +# gem 'nokogiri', '1.4.1' +# gem 'sqlite3-ruby', :require => 'sqlite3' +# gem 'aws-s3', :require => 'aws/s3' + +# Bundle gems for certain environments: +# gem 'rspec', :group => :test +# group :test do +# gem 'webrat' +# end diff --git a/Rakefile b/Rakefile index 4af6943..9cb2046 100644 --- a/Rakefile +++ b/Rakefile @@ -1,17 +1,10 @@ # 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.join(File.dirname(__FILE__), 'config', 'boot')) +require File.expand_path('../config/application', __FILE__) require 'rake' require 'rake/testtask' require 'rake/rdoctask' -require 'tasks/rails' - -Rake::Task["db:test:prepare"].enhance(['db:test:purge', 'db:schema:load']) do - Rake::Task["db:test:prepare"].reenable - Rake::Task["db:test:purge"].reenable - Rake::Task["db:schema:load"].reenable -end - +Rails::Application.load_tasks diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 281dc1c..87bec85 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -10,14 +10,11 @@ class ApplicationController < ActionController::Base # Uncomment the :secret if you're not using the cookie session store # protect_from_forgery # :secret => 'fd4b65ee1595df77234ee4ea6a277542' - filter_parameter_logging "password" - # See ActionController::Base for details # Uncomment this to filter the contents of submitted sensitive data parameters # from your application log (in this case, all fields with names like "password"). # filter_parameter_logging :password - protected def set_locale_now diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index 53286b4..b6093e1 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb @@ -8,10 +8,7 @@ <%= stylesheet_link_tag 'datepicker' %> <%= stylesheet_link_tag 'journals' %> <%= stylesheet_link_tag 'lodo' %> - <%= javascript_include_tag 'jquery' %> - <% Dir.open("#{RAILS_ROOT}/public/javascripts/").reject {|f| File.directory?("#{RAILS_ROOT}/public/javascripts/" + f)}.reject {|f| f.to_s =~ /jquery/ }.reject{|f| f.to_s =~ /^\.+$/}.each do |js| -%> - - <% end %> + <%= javascript_include_tag :all %> - \ No newline at end of file + diff --git a/public/500.html b/public/500.html index 0cd07c1..b80307f 100644 --- a/public/500.html +++ b/public/500.html @@ -1,23 +1,19 @@ - - - - + + - We're sorry, but something went wrong (500) - + @@ -25,9 +21,6 @@

We're sorry, but something went wrong.

We've been notified about this issue and we'll take a look at it shortly.

-

(If you're the administrator of this website, then please read - the log file "<%=h RAILS_ENV %>.log" - to find out what went wrong.)

diff --git a/script/rails b/script/rails new file mode 100755 index 0000000..9eb7910 --- /dev/null +++ b/script/rails @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby1.8 +# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. + +ENV_PATH = File.expand_path('../../config/environment', __FILE__) +BOOT_PATH = File.expand_path('../../config/boot', __FILE__) +APP_PATH = File.expand_path('../../config/application', __FILE__) + +require BOOT_PATH +require 'rails/commands' diff --git a/test/test_helper.rb b/test/test_helper.rb index 787d5ab..9c331dd 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,53 +1,16 @@ ENV["RAILS_ENV"] = "test" -require File.expand_path(File.dirname(__FILE__) + "/../config/environment") -require 'test_help' +require File.expand_path('../../config/environment', __FILE__) +require 'rails/test_help' -# machinist require File.expand_path(File.dirname(__FILE__) + "/blueprints") - class ActiveSupport::TestCase - # Transactional fixtures accelerate your tests by wrapping each test method - # in a transaction that's rolled back on completion. This ensures that the - # test database remains unchanged so your fixtures don't have to be reloaded - # between every test method. Fewer database queries means faster tests. - # - # Read Mike Clark's excellent walkthrough at - # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting - # - # Every Active Record database supports transactions except MyISAM tables - # in MySQL. Turn off transactional fixtures in this case; however, if you - # don't care one way or the other, switching from MyISAM to InnoDB tables - # is recommended. - # - # The only drawback to using transactional fixtures is when you actually - # need to test transactions. Since your test is bracketed by a transaction, - # any transactions started in your code will be automatically rolled back. - self.use_transactional_fixtures = true - - # Instantiated fixtures are slow, but give you @david where otherwise you - # would need people(:david). If you don't want to migrate your existing - # test cases which use the @david style and don't mind the speed hit (each - # instantiated fixtures translates to a database query per test method), - # then set this back to true. - self.use_instantiated_fixtures = false - # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. # # Note: You'll currently still have to declare fixtures explicitly in integration tests # -- they do not yet inherit this setting - #fixtures :all - + # fixtures :all + # Add more helper methods to be used by all tests here... - setup do - # might run out of unique values like this, - # but at least there won't be dupes.. - # Sham.reset - end - + end - -class ActionController::TestCase - include Devise::TestHelpers -end -