Skip to content

Commit

Permalink
Rails 4 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
John Wood committed Jul 9, 2013
1 parent ed114f6 commit 86c011f
Show file tree
Hide file tree
Showing 29 changed files with 360 additions and 345 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.bundle
.powenv
.ruby-version
db/development.sqlite3
db/schema.rb
Expand Down
21 changes: 11 additions & 10 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
source 'https://rubygems.org'
ruby '2.0.0'

gem 'rails', '3.2.13'
gem 'jquery-rails', '1.0.16'
gem 'jquery-ui-rails', '2.0.2'
gem 'rails', '4.0.0'
gem 'mysql2'

gem 'capistrano'
Expand All @@ -11,13 +10,15 @@ gem 'json'
gem 'dynamic_form'
gem 'rails_autolink'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
gem 'sass-rails'
gem 'coffee-rails'
gem 'jquery-rails', '2.0.3'
gem 'jquery-ui-rails', '2.0.2'
gem 'therubyracer'
gem 'uglifier'

group :development do
gem 'thin'
end

group :test do
Expand Down
192 changes: 94 additions & 98 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,85 +2,79 @@ GEM
remote: https://rubygems.org/
specs:
Ascii85 (1.0.2)
actionmailer (3.2.13)
actionpack (= 3.2.13)
actionmailer (4.0.0)
actionpack (= 4.0.0)
mail (~> 2.5.3)
actionpack (3.2.13)
activemodel (= 3.2.13)
activesupport (= 3.2.13)
builder (~> 3.0.0)
actionpack (4.0.0)
activesupport (= 4.0.0)
builder (~> 3.1.0)
erubis (~> 2.7.0)
journey (~> 1.0.4)
rack (~> 1.4.5)
rack-cache (~> 1.2)
rack-test (~> 0.6.1)
sprockets (~> 2.2.1)
activemodel (3.2.13)
activesupport (= 3.2.13)
builder (~> 3.0.0)
activerecord (3.2.13)
activemodel (= 3.2.13)
activesupport (= 3.2.13)
arel (~> 3.0.2)
tzinfo (~> 0.3.29)
activeresource (3.2.13)
activemodel (= 3.2.13)
activesupport (= 3.2.13)
activesupport (3.2.13)
i18n (= 0.6.1)
multi_json (~> 1.0)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
activemodel (4.0.0)
activesupport (= 4.0.0)
builder (~> 3.1.0)
activerecord (4.0.0)
activemodel (= 4.0.0)
activerecord-deprecated_finders (~> 1.0.2)
activesupport (= 4.0.0)
arel (~> 4.0.0)
activerecord-deprecated_finders (1.0.3)
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)
afm (0.2.0)
arel (3.0.2)
bourne (1.4.0)
mocha (~> 0.13.2)
builder (3.0.4)
capistrano (2.12.0)
arel (4.0.0)
atomic (1.1.10)
builder (3.1.4)
capistrano (2.15.4)
highline
net-scp (>= 1.0.0)
net-sftp (>= 2.0.0)
net-ssh (>= 2.0.14)
net-ssh-gateway (>= 1.1.0)
coffee-rails (3.2.2)
coffee-rails (4.0.0)
coffee-script (>= 2.2.0)
railties (~> 3.2.0)
railties (>= 4.0.0.beta, < 5.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.6.2)
daemons (1.1.9)
dynamic_form (1.1.4)
erubis (2.7.0)
eventmachine (1.0.3)
execjs (1.4.0)
multi_json (~> 1.0)
hashery (2.1.0)
highline (1.6.15)
hike (1.2.1)
i18n (0.6.1)
journey (1.0.4)
jquery-rails (1.0.16)
railties (~> 3.0)
highline (1.6.19)
hike (1.2.3)
i18n (0.6.4)
jquery-rails (2.0.3)
railties (>= 3.1.0, < 5.0)
thor (~> 0.14)
jquery-ui-rails (2.0.2)
jquery-rails
railties (>= 3.1.0)
json (1.7.7)
libv8 (3.11.8.13)
mail (2.5.3)
i18n (>= 0.4.0)
json (1.8.0)
libv8 (3.11.8.17)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
metaclass (0.0.1)
mime-types (1.22)
mocha (0.13.3)
metaclass (~> 0.0.1)
multi_json (1.7.2)
mime-types (1.23)
minitest (4.7.5)
multi_json (1.7.7)
mysql2 (0.3.11)
net-scp (1.0.4)
net-ssh (>= 1.99.1)
net-sftp (2.0.5)
net-ssh (>= 2.0.9)
net-ssh (2.6.2)
net-ssh-gateway (1.1.0)
net-ssh (>= 1.99.1)
net-scp (1.1.1)
net-ssh (>= 2.6.5)
net-sftp (2.1.2)
net-ssh (>= 2.6.5)
net-ssh (2.6.7)
net-ssh-gateway (1.2.0)
net-ssh (>= 2.6.5)
pdf-reader (1.3.3)
Ascii85 (~> 1.0.0)
afm (~> 0.2.0)
Expand All @@ -93,67 +87,68 @@ GEM
ttfunk (~> 1.0.2)
prawn-labels (0.11.5.0)
prawn (>= 0.12.0)
rack (1.4.5)
rack-cache (1.2)
rack (>= 0.4)
rack-ssl (1.3.3)
rack
rack (1.5.2)
rack-test (0.6.2)
rack (>= 1.0)
rails (3.2.13)
actionmailer (= 3.2.13)
actionpack (= 3.2.13)
activerecord (= 3.2.13)
activeresource (= 3.2.13)
activesupport (= 3.2.13)
bundler (~> 1.0)
railties (= 3.2.13)
rails_autolink (1.0.6)
rails (~> 3.1)
railties (3.2.13)
actionpack (= 3.2.13)
activesupport (= 3.2.13)
rack-ssl (~> 1.3.2)
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)
sprockets-rails (~> 2.0.0)
rails_autolink (1.1.0)
rails (> 3.1)
railties (4.0.0)
actionpack (= 4.0.0)
activesupport (= 4.0.0)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
rake (10.0.4)
rdoc (3.12.2)
json (~> 1.4)
ref (1.0.2)
thor (>= 0.18.1, < 2.0)
rake (10.1.0)
ref (1.0.5)
ruby-rc4 (0.1.5)
sass (3.2.7)
sass-rails (3.2.6)
railties (~> 3.2.0)
sass (3.2.9)
sass-rails (4.0.0)
railties (>= 4.0.0.beta, < 5.0)
sass (>= 3.1.10)
tilt (~> 1.3)
shoulda (3.4.0)
sprockets-rails (~> 2.0.0)
shoulda (3.5.0)
shoulda-context (~> 1.0, >= 1.0.1)
shoulda-matchers (~> 1.0, >= 1.4.1)
shoulda-context (1.0.2)
shoulda-matchers (1.5.6)
shoulda-matchers (>= 1.4.1, < 3.0)
shoulda-context (1.1.4)
shoulda-matchers (2.2.0)
activesupport (>= 3.0.0)
bourne (~> 1.3)
simplecov (0.7.1)
multi_json (~> 1.0)
simplecov-html (~> 0.7.1)
simplecov-html (0.7.1)
sprockets (2.2.2)
sprockets (2.10.0)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
therubyracer (0.11.3)
sprockets-rails (2.0.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (~> 2.8)
therubyracer (0.11.4)
libv8 (~> 3.11.8.12)
ref
thin (1.5.1)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
thor (0.18.1)
tilt (1.3.6)
treetop (1.4.12)
thread_safe (0.1.0)
atomic
tilt (1.4.1)
treetop (1.4.14)
polyglot
polyglot (>= 0.3.1)
ttfunk (1.0.3)
tzinfo (0.3.37)
uglifier (1.3.0)
uglifier (2.1.1)
execjs (>= 0.3.0)
multi_json (~> 1.0, >= 1.0.2)

Expand All @@ -162,17 +157,18 @@ PLATFORMS

DEPENDENCIES
capistrano
coffee-rails (~> 3.2.1)
coffee-rails
dynamic_form
jquery-rails (= 1.0.16)
jquery-rails (= 2.0.3)
jquery-ui-rails (= 2.0.2)
json
mysql2
prawn-labels
rails (= 3.2.13)
rails (= 4.0.0)
rails_autolink
sass-rails (~> 3.2.3)
sass-rails
shoulda
simplecov
therubyracer
uglifier (>= 1.0.3)
thin
uglifier
14 changes: 10 additions & 4 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,14 @@ function hideSpinner() {
$('#spinner').css({"visibility":"hidden"});
}

$(".ajax_request, .button_to").
live('ajax:before', function() { showSpinner(); }).
live('ajax:complete', function() { hideSpinner(); });

$(document).on('ajaxSend', showSpinner);
$(document).on('ajaxComplete', hideSpinner);

$(document).on('click', '.edit_address_link', editAddress);
$(document).on('click', '.cancel_multiple_address_confirmation_link', closeFancybox);
$(document).on('click', '.maintain_group_members_link', displayMaintainGroupMembers);
$(document).on('click', '.exclude_all_members_link', excludeAllMembers);
$(document).on('click', '.exclude_selected_members_link', excludeSelectedMembers);
$(document).on('click', '.include_selected_members_link', includeSelectedMembers);
$(document).on('click', '.include_all_members_link', includeAllMembers);

16 changes: 10 additions & 6 deletions app/controllers/addresses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,24 @@ def show
end

def update
@address.update_attributes(params[:address])
@address.update_attributes(address_params)
@saved = @address.save
render 'edit_address'
end

def destroy
@address.ergo.destroy
render 'delete_address'
end

private

def load_address
@address = Address.find_by_id(params[:id])
end

def load_address
@address = Address.find_by_id(params[:id])
end

def address_params
params.require(:address).permit(:address1, :address2, :city, :state, :zip, :home_phone, :contact1_id, :contact2_id, :address_type_id)
end

end
24 changes: 12 additions & 12 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ def use_desktop_view

private

def authenticate
if Rails.env == 'production'
username = Settings.username
password = Settings.password

if !username.blank? && !password.blank?
authenticate_or_request_with_http_basic("Addressbook") do |http_username, http_password|
http_username == username && Password.encode(http_password) == password
end
def authenticate
if Rails.env == 'production'
username = Settings.username
password = Settings.password

if !username.blank? && !password.blank?
authenticate_or_request_with_http_basic("Addressbook") do |http_username, http_password|
http_username == username && Password.encode(http_password) == password
end
end
end
end

def set_request_format
request.format = :mobile if is_mobile_device?
end
def set_request_format
request.format = :mobile if is_mobile_device?
end

end
Loading

0 comments on commit 86c011f

Please sign in to comment.