Permalink
Browse files

Update to Rails 4.0.0

  • Loading branch information...
1 parent 076ecfb commit 71b86434d49b8d4e52442e8bd93aa9449bc3c9b2 @mischa78 committed Jun 26, 2013
View
16 Gemfile
@@ -1,16 +1,16 @@
-source 'http://rubygems.org'
+source 'https://rubygems.org'
-gem 'rails', '4.0.0.rc2'
+gem 'rails', '4.0.0'
+gem 'sqlite3'
+gem 'sass-rails', '~> 4.0.0'
+gem 'uglifier', '>= 1.3.0'
+gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
+
+# App specific gems
gem 'dynamic_form'
gem 'acts_as_tree'
gem 'paperclip'
-
-gem 'sqlite3'
-
-gem 'sass-rails', '~> 4.0.0.rc2'
-gem 'coffee-rails', '~> 4.0.0'
-gem 'uglifier', '>= 1.3.0'
gem 'jquery-fileupload-rails'
group :test do
View
@@ -1,31 +1,31 @@
GEM
- remote: http://rubygems.org/
+ remote: https://rubygems.org/
specs:
- actionmailer (4.0.0.rc2)
- actionpack (= 4.0.0.rc2)
+ actionmailer (4.0.0)
+ actionpack (= 4.0.0)
mail (~> 2.5.3)
- actionpack (4.0.0.rc2)
- activesupport (= 4.0.0.rc2)
+ actionpack (4.0.0)
+ activesupport (= 4.0.0)
builder (~> 3.1.0)
erubis (~> 2.7.0)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
- activemodel (4.0.0.rc2)
- activesupport (= 4.0.0.rc2)
+ activemodel (4.0.0)
+ activesupport (= 4.0.0)
builder (~> 3.1.0)
- activerecord (4.0.0.rc2)
- activemodel (= 4.0.0.rc2)
+ activerecord (4.0.0)
+ activemodel (= 4.0.0)
activerecord-deprecated_finders (~> 1.0.2)
- activesupport (= 4.0.0.rc2)
+ activesupport (= 4.0.0)
arel (~> 4.0.0)
activerecord-deprecated_finders (1.0.3)
- activesupport (4.0.0.rc2)
+ activesupport (4.0.0)
i18n (~> 0.6, >= 0.6.4)
minitest (~> 4.2)
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
- acts_as_tree (1.3.0)
+ acts_as_tree (1.4.0)
activerecord (>= 3.0.0)
arel (4.0.0)
atomic (1.1.9)
@@ -62,8 +62,8 @@ GEM
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.23)
- minitest (4.7.4)
- multi_json (1.7.6)
+ minitest (4.7.5)
+ multi_json (1.7.7)
paperclip (3.4.2)
activemodel (>= 3.0.0)
activerecord (>= 3.0.0)
@@ -74,22 +74,22 @@ GEM
rack (1.5.2)
rack-test (0.6.2)
rack (>= 1.0)
- rails (4.0.0.rc2)
- actionmailer (= 4.0.0.rc2)
- actionpack (= 4.0.0.rc2)
- activerecord (= 4.0.0.rc2)
- activesupport (= 4.0.0.rc2)
+ rails (4.0.0)
+ actionmailer (= 4.0.0)
+ actionpack (= 4.0.0)
+ activerecord (= 4.0.0)
+ activesupport (= 4.0.0)
bundler (>= 1.3.0, < 2.0)
- railties (= 4.0.0.rc2)
+ railties (= 4.0.0)
sprockets-rails (~> 2.0.0)
- railties (4.0.0.rc2)
- actionpack (= 4.0.0.rc2)
- activesupport (= 4.0.0.rc2)
+ railties (4.0.0)
+ actionpack (= 4.0.0)
+ activesupport (= 4.0.0)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
- rake (10.0.4)
+ rake (10.1.0)
sass (3.2.9)
- sass-rails (4.0.0.rc2)
+ sass-rails (4.0.0)
railties (>= 4.0.0.beta, < 5.0)
sass (>= 3.1.10)
sprockets-rails (~> 2.0.0)
@@ -126,7 +126,7 @@ DEPENDENCIES
jquery-fileupload-rails
jquery-rails
paperclip
- rails (= 4.0.0.rc2)
- sass-rails (~> 4.0.0.rc2)
+ rails (= 4.0.0)
+ sass-rails (~> 4.0.0)
sqlite3
uglifier (>= 1.3.0)
View
@@ -1,6 +1,6 @@
# Boxroom
-[![Build Status](https://api.travis-ci.org/mischa78/boxroom.png?branch=rails4)](http://travis-ci.org/mischa78/boxroom)
+[![Build Status](https://api.travis-ci.org/mischa78/boxroom.png)](http://travis-ci.org/mischa78/boxroom)
[![Dependency Status](https://gemnasium.com/mischa78/boxroom.png?travis)](https://gemnasium.com/mischa78/boxroom)
[![Code Climate](https://codeclimate.com/github/mischa78/boxroom.png)](https://codeclimate.com/github/mischa78/boxroom)
@@ -20,7 +20,7 @@ Requirements
The requirements for running Boxroom are:
* Ruby 2.0.0 or 1.9.3
- * Rails 4.0.0.rc1
+ * Rails 4.0.0
* A database (e.g. MySQL or SQLite)
View
@@ -2,6 +2,5 @@
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
-require 'rake'
Boxroom::Application.load_tasks
@@ -41,9 +41,9 @@ td img { padding: 0; }
.user_welcome { float: right; margin-right: 15px; }
.user_welcome a { color: #FFF; text-decoration: underline; }
.user_groups { margin-right: 200px; display: block; }
+.user_groups label { margin-right: 15px; }
.user_name, .user_expiration { min-width: 180px; }
.user_email, .group_name, .clipboard_item { min-width: 370px; }
-.group { margin-right: 15px; }
.file_name { min-width: 250px; max-width: 400px; overflow: hidden; }
.file_name a, .shared_file a { color: #000; text-decoration: underline; }
.file_size { min-width: 100px; }
View
@@ -17,6 +17,10 @@ def self.admins_group
where(:name => 'Admins').first
end
+ def self.all_except_admins
+ where.not(:name => 'Admins')
+ end
+
private
def create_admin_permissions
@@ -19,7 +19,7 @@ def share_link_attributes
def user_attributes
if current_user && current_user.member_of_admins?
- [:name, :email, :password, :password_confirmation, :group_ids]
+ [:name, :email, :password, :password_confirmation, { :group_ids => [] }]
else
[:name, :email, :password, :password_confirmation]
end
@@ -24,19 +24,14 @@
<p>
<%= t :member_of_these_groups %>:
<span class="user_groups">
- <% Group.all.each do |group| -%>
- <% if @user.is_admin && group.admins_group? -%>
- <span class="group nowrap disabled">
- <%= hidden_field_tag 'user[group_ids][]', group.id %>
- <input type="checkbox" checked="checked" disabled="disabled" />
- <%= group.name %>
+ <% if @user.is_admin -%>
+ <span class="disabled">
+ <%= hidden_field_tag 'user[group_ids][]', Group.admins_group.id %>
+ <input type="checkbox" checked="checked" disabled="disabled" /><label>Admins</label>
</span>
+ <%= f.collection_check_boxes :group_ids, Group.all_except_admins, :id, :name %>
<% else -%>
- <span class="group nowrap">
- <%= check_box_tag 'user[group_ids][]', group.id, @user.group_ids.include?(group.id), :id => dom_id(group) %>
- <%= label_tag dom_id(group), group.name %>
- </span>
- <% end -%>
+ <%= f.collection_check_boxes :group_ids, Group.all, :id, :name %>
<% end -%>
</span>
</p>
View
@@ -1,4 +1,4 @@
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
-run Boxroom::Application
+run Rails.application
View
@@ -1,5 +1,5 @@
-# Load the rails application
+# Load the Rails application.
require File.expand_path('../application', __FILE__)
-# Initialize the rails application
+# Initialize the Rails application.
Boxroom::Application.initialize!
@@ -23,10 +23,10 @@
config.serve_static_assets = false
# Compress JavaScripts and CSS.
- config.assets.js_compressor = :uglifier
+ config.assets.js_compressor = :uglifier
# config.assets.css_compressor = :sass
- # Whether to fallback to assets pipeline if a precompiled asset is missed.
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
# Generate digests for assets URLs.
@@ -13,7 +13,7 @@
config.eager_load = false
# Configure static asset server for tests with Cache-Control for performance.
- config.serve_static_assets = true
+ config.serve_static_assets = true
config.static_cache_control = "public, max-age=3600"
# Show full error reports and disable caching.

0 comments on commit 71b8643

Please sign in to comment.