Skip to content

Commit

Permalink
transitionally downgraded to Rails 4.1 since activerecord-jdbcpostgre…
Browse files Browse the repository at this point in the history
…sql-adapter is not fully compatible with Active Record 4.2
  • Loading branch information
Hauke Klement committed Mar 2, 2015
1 parent 03486bf commit 7477d4c
Show file tree
Hide file tree
Showing 17 changed files with 107 additions and 174 deletions.
6 changes: 3 additions & 3 deletions Gemfile
Expand Up @@ -4,7 +4,7 @@ gem 'activerecord-jdbcpostgresql-adapter', platform: :jruby
gem 'bcrypt', '~> 3.1.7'
gem 'bootstrap-will_paginate'
gem 'carrierwave'
gem 'coffee-rails', '~> 4.1.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'concurrent-ruby'
gem 'concurrent-ruby-ext', platform: :ruby
gem 'docker-api', require: 'docker'
Expand All @@ -20,11 +20,11 @@ gem 'pg', platform: :ruby
gem 'pry'
gem 'puma'
gem 'pundit'
gem 'rails', '~> 4.2.0'
gem 'rails', '~> 4.1.2'
gem 'rails-i18n', '~> 4.0.0'
gem 'ransack'
gem 'rubytree'
gem 'sass-rails', '~> 5.0'
gem 'sass-rails', '~> 4.0.3'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'slim'
gem 'sorcery'
Expand Down
111 changes: 44 additions & 67 deletions Gemfile.lock
Expand Up @@ -2,48 +2,39 @@ GEM
remote: https://rubygems.org/
specs:
ZenTest (4.11.0)
actionmailer (4.2.0)
actionpack (= 4.2.0)
actionview (= 4.2.0)
activejob (= 4.2.0)
actionmailer (4.1.9)
actionpack (= 4.1.9)
actionview (= 4.1.9)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.0)
actionview (= 4.2.0)
activesupport (= 4.2.0)
rack (~> 1.6.0)
actionpack (4.1.9)
actionview (= 4.1.9)
activesupport (= 4.1.9)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.1)
actionview (4.2.0)
activesupport (= 4.2.0)
actionview (4.1.9)
activesupport (= 4.1.9)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.1)
activejob (4.2.0)
activesupport (= 4.2.0)
globalid (>= 0.3.0)
activemodel (4.2.0)
activesupport (= 4.2.0)
activemodel (4.1.9)
activesupport (= 4.1.9)
builder (~> 3.1)
activerecord (4.2.0)
activemodel (= 4.2.0)
activesupport (= 4.2.0)
arel (~> 6.0)
activerecord (4.1.9)
activemodel (= 4.1.9)
activesupport (= 4.1.9)
arel (~> 5.0.0)
activerecord-jdbc-adapter (1.3.14)
activerecord (>= 2.2)
activerecord-jdbcpostgresql-adapter (1.3.14)
activerecord-jdbc-adapter (~> 1.3.14)
jdbc-postgres (>= 9.1)
activesupport (4.2.0)
i18n (~> 0.7)
activesupport (4.1.9)
i18n (~> 0.6, >= 0.6.9)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
thread_safe (~> 0.1)
tzinfo (~> 1.1)
archive-tar-minitar (0.5.2)
arel (6.0.0)
arel (5.0.1.20140414130214)
ast (2.0.0)
astrolabe (1.3.0)
parser (>= 2.2.0.pre.3, < 3.0)
Expand Down Expand Up @@ -100,7 +91,7 @@ GEM
codeclimate-test-reporter (0.4.7)
simplecov (>= 0.7.1, < 1.0.0)
coderay (1.1.0)
coffee-rails (4.1.0)
coffee-rails (4.0.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.0)
coffee-script (2.3.0)
Expand Down Expand Up @@ -136,8 +127,6 @@ GEM
ffi (1.9.6)
ffi (1.9.6-java)
forgery (0.6.0)
globalid (0.3.3)
activesupport (>= 4.1.0)
highline (1.7.1)
hike (1.2.3)
i18n (0.7.0)
Expand All @@ -148,9 +137,8 @@ GEM
activesupport (>= 3.0.0, < 5)
multi_json (~> 1.2)
jdbc-postgres (9.4.1200)
jquery-rails (4.0.3)
rails-dom-testing (~> 1.0)
railties (>= 4.2.0)
jquery-rails (3.1.2)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
jquery-turbolinks (2.1.0)
railties (>= 3.1.0)
Expand All @@ -159,8 +147,6 @@ GEM
json (1.8.2-java)
jwt (1.3.0)
kramdown (1.6.0)
loofah (2.0.1)
nokogiri (>= 1.5.9)
mail (2.6.3)
mime-types (>= 1.16, < 3)
method_source (0.8.2)
Expand Down Expand Up @@ -206,34 +192,25 @@ GEM
rack (>= 1.1, < 2.0)
pundit (0.3.0)
activesupport (>= 3.0.0)
rack (1.6.0)
rack (1.5.2)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.0)
actionmailer (= 4.2.0)
actionpack (= 4.2.0)
actionview (= 4.2.0)
activejob (= 4.2.0)
activemodel (= 4.2.0)
activerecord (= 4.2.0)
activesupport (= 4.2.0)
rails (4.1.9)
actionmailer (= 4.1.9)
actionpack (= 4.1.9)
actionview (= 4.1.9)
activemodel (= 4.1.9)
activerecord (= 4.1.9)
activesupport (= 4.1.9)
bundler (>= 1.3.0, < 2.0)
railties (= 4.2.0)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.5)
activesupport (>= 4.2.0.beta, < 5.0)
nokogiri (~> 1.6.0)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.1)
loofah (~> 2.0)
railties (= 4.1.9)
sprockets-rails (~> 2.0)
rails-i18n (4.0.4)
i18n (~> 0.6)
railties (~> 4.0)
railties (4.2.0)
actionpack (= 4.2.0)
activesupport (= 4.2.0)
railties (4.1.9)
actionpack (= 4.1.9)
activesupport (= 4.1.9)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rainbow (2.0.0)
Expand All @@ -245,6 +222,7 @@ GEM
i18n
polyamorous (~> 1.1)
rdoc (4.2.0)
json (~> 1.4)
ref (1.0.5)
rspec (3.1.0)
rspec-core (~> 3.1.0)
Expand Down Expand Up @@ -280,13 +258,12 @@ GEM
json (~> 1.8)
structured_warnings (~> 0.1)
rubyzip (1.1.7)
sass (3.4.13)
sass-rails (5.0.1)
sass (3.2.19)
sass-rails (4.0.5)
railties (>= 4.0.0, < 5.0)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (~> 1.1)
sass (~> 3.2.2)
sprockets (~> 2.8, < 3.0)
sprockets-rails (~> 2.0)
sdoc (0.4.1)
json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0)
Expand Down Expand Up @@ -367,7 +344,7 @@ DEPENDENCIES
capybara
carrierwave
codeclimate-test-reporter
coffee-rails (~> 4.1.0)
coffee-rails (~> 4.0.0)
concurrent-ruby
concurrent-ruby-ext
database_cleaner
Expand All @@ -385,7 +362,7 @@ DEPENDENCIES
pry
puma
pundit
rails (~> 4.2.0)
rails (~> 4.1.2)
rails-i18n (~> 4.0.0)
rake
ransack
Expand All @@ -394,7 +371,7 @@ DEPENDENCIES
rubocop
rubocop-rspec
rubytree
sass-rails (~> 5.0)
sass-rails (~> 4.0.3)
sdoc (~> 0.4.0)
selenium-webdriver
simplecov
Expand Down
2 changes: 1 addition & 1 deletion app/models/exercise.rb
Expand Up @@ -25,7 +25,7 @@ def average_percentage

def average_score
if submissions.exists?(cause: 'submit')
maximum_scores_query = submissions.select('MAX(score) AS maximum_score').where(cause: 'submit').group(:user_id).to_sql
maximum_scores_query = submissions.select('MAX(score) AS maximum_score').where(cause: 'submit').group(:user_id).to_sql.sub('$1', id.to_s)
self.class.connection.execute("SELECT AVG(maximum_score) AS average_score FROM (#{maximum_scores_query}) AS maximum_scores").first['average_score'].to_f
end
end
Expand Down
6 changes: 1 addition & 5 deletions bin/rails
@@ -1,8 +1,4 @@
#!/usr/bin/env ruby
begin
load File.expand_path("../spring", __FILE__)
rescue LoadError
end
APP_PATH = File.expand_path('../../config/application', __FILE__)
APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot'
require 'rails/commands'
4 changes: 0 additions & 4 deletions bin/rake
@@ -1,8 +1,4 @@
#!/usr/bin/env ruby
begin
load File.expand_path("../spring", __FILE__)
rescue LoadError
end
require_relative '../config/boot'
require 'rake'
Rake.application.run
29 changes: 0 additions & 29 deletions bin/setup

This file was deleted.

11 changes: 7 additions & 4 deletions bin/spring
@@ -1,14 +1,17 @@
#!/usr/bin/env ruby

# This file loads spring without using Bundler, in order to be fast.
# It gets overwritten when you run the `spring binstub` command.
# This file loads spring without using Bundler, in order to be fast
# It gets overwritten when you run the `spring binstub` command

unless defined?(Spring)
require "rubygems"
require "bundler"

if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)
Gem.paths = { "GEM_PATH" => Bundler.bundle_path.to_s }
if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m)
ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR)
ENV["GEM_HOME"] = ""
Gem.paths = ENV

gem "spring", match[1]
require "spring/binstub"
end
Expand Down
2 changes: 1 addition & 1 deletion config.ru
@@ -1,4 +1,4 @@
# This file is used by Rack-based servers to start the application.

require ::File.expand_path('../config/environment', __FILE__)
require ::File.expand_path('../config/environment', __FILE__)
run Rails.application
12 changes: 8 additions & 4 deletions config/application.rb
@@ -1,6 +1,13 @@
require File.expand_path('../boot', __FILE__)

require 'rails/all'
# Pick the frameworks you want:
require "active_model/railtie"
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
require "sprockets/railtie"
# require "rails/test_unit/railtie"

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Expand All @@ -21,9 +28,6 @@ class Application < Rails::Application
# config.i18n.default_locale = :de
config.i18n.available_locales = [:de, :en]

# Do not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true

config.autoload_paths << Rails.root.join('lib')
config.eager_load_paths << Rails.root.join('lib')
end
Expand Down
3 changes: 2 additions & 1 deletion config/boot.rb
@@ -1,3 +1,4 @@
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)

require 'bundler/setup' # Set up gems listed in the Gemfile.
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
11 changes: 2 additions & 9 deletions config/environments/development.rb
Expand Up @@ -13,6 +13,8 @@
config.consider_all_requests_local = true
config.action_controller.perform_caching = false

config.action_mailer.perform_deliveries = true

# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false

Expand All @@ -22,15 +24,6 @@
# Raise an error on page load if there are pending migrations.
config.active_record.migration_error = :page_load

# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = true

# Asset digests allow you to set far-future HTTP expiration dates on all assets,
# yet still be able to expire them through the digest params.
config.assets.digest = true

# Adds additional error checking when serving assets at runtime.
# Checks for improperly declared sprockets dependencies.
# Raises helpful error messages.
Expand Down

0 comments on commit 7477d4c

Please sign in to comment.