diff --git a/Gemfile b/Gemfile index 0734cf7..0633e4b 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,7 @@ source 'https://rubygems.org' gem 'rails', '4.1.0' +gem 'protected_attributes' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' @@ -15,9 +16,8 @@ gem 'devise' # 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 'sass-rails', '~> 4.0.3' + gem 'coffee-rails' # See https://github.com/sstephenson/execjs#readme for more supported runtimes # gem 'therubyracer', :platform => :ruby diff --git a/Gemfile.lock b/Gemfile.lock index b6169de..ef15de7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,138 +1,150 @@ GEM remote: https://rubygems.org/ specs: - actionmailer (3.2.13) - actionpack (= 3.2.13) - mail (~> 2.5.3) - actionpack (3.2.13) - activemodel (= 3.2.13) - activesupport (= 3.2.13) - builder (~> 3.0.0) + actionmailer (4.1.0) + actionpack (= 4.1.0) + actionview (= 4.1.0) + mail (~> 2.5.4) + actionpack (4.1.0) + actionview (= 4.1.0) + activesupport (= 4.1.0) + rack (~> 1.5.2) + rack-test (~> 0.6.2) + actionview (4.1.0) + activesupport (= 4.1.0) + builder (~> 3.1) 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) - arel (3.0.2) - asset_sync (0.5.4) + activemodel (4.1.0) + activesupport (= 4.1.0) + builder (~> 3.1) + activerecord (4.1.0) + activemodel (= 4.1.0) + activesupport (= 4.1.0) + arel (~> 5.0.0) + activesupport (4.1.0) + i18n (~> 0.6, >= 0.6.9) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.1) + tzinfo (~> 1.1) + arel (5.0.1.20140414130214) + asset_sync (1.0.0) activemodel - fog - bcrypt-ruby (3.0.1) - builder (3.0.4) - coffee-rails (3.2.2) + fog (>= 1.8.0) + bcrypt (3.1.7) + builder (3.2.2) + coffee-rails (4.0.1) coffee-script (>= 2.2.0) - railties (~> 3.2.0) + railties (>= 4.0.0, < 5.0) coffee-script (2.2.0) coffee-script-source execjs - coffee-script-source (1.4.0) + coffee-script-source (1.7.0) daemons (1.1.9) - devise (2.2.2) - bcrypt-ruby (~> 3.0) + devise (3.2.4) + bcrypt (~> 3.0) orm_adapter (~> 0.1) - railties (~> 3.1) - warden (~> 1.2.1) + railties (>= 3.2.6, < 5) + thread_safe (~> 0.1) + warden (~> 1.2.3) erubis (2.7.0) - eventmachine (1.0.0) - excon (0.16.10) - execjs (1.4.0) - multi_json (~> 1.0) - fog (1.9.0) + eventmachine (1.0.3) + excon (0.37.0) + execjs (2.2.0) + fog (1.22.1) + fog-brightbox + fog-core (~> 1.22) + fog-json + ipaddress (~> 0.5) + nokogiri (~> 1.5, >= 1.5.11) + fog-brightbox (0.0.2) + fog-core + fog-json + fog-core (1.22.0) builder - excon (~> 0.14) - formatador (~> 0.2.0) + excon (~> 0.33) + formatador (~> 0.2) mime-types - multi_json (~> 1.0) - net-scp (~> 1.0.4) + net-scp (~> 1.1) net-ssh (>= 2.1.3) - nokogiri (~> 1.5.0) - ruby-hmac - formatador (0.2.4) + fog-json (1.0.0) + multi_json (~> 1.0) + formatador (0.2.5) hike (1.2.3) - i18n (0.6.1) - journey (1.0.4) - jquery-rails (2.2.0) + i18n (0.6.9) + ipaddress (0.8.0) + jquery-rails (3.1.0) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) - json (1.8.0) + json (1.8.1) mail (2.5.4) mime-types (~> 1.16) treetop (~> 1.4.8) - mime-types (1.23) - multi_json (1.7.7) - net-scp (1.0.4) - net-ssh (>= 1.99.1) - net-ssh (2.6.3) - nokogiri (1.5.6) - orm_adapter (0.4.0) - pg (0.14.1) - polyglot (0.3.3) - rack (1.4.5) - rack-cache (1.2) - rack (>= 0.4) - rack-ssl (1.3.3) - rack + mime-types (1.25.1) + mini_portile (0.6.0) + minitest (5.3.5) + multi_json (1.10.1) + net-scp (1.2.1) + net-ssh (>= 2.6.5) + net-ssh (2.9.1) + nokogiri (1.6.2.1) + mini_portile (= 0.6.0) + orm_adapter (0.5.0) + pg (0.17.1) + polyglot (0.3.5) + protected_attributes (1.0.8) + activemodel (>= 4.0.1, < 5.0) + 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) - railties (3.2.13) - actionpack (= 3.2.13) - activesupport (= 3.2.13) - rack-ssl (~> 1.3.2) + rails (4.1.0) + actionmailer (= 4.1.0) + actionpack (= 4.1.0) + actionview (= 4.1.0) + activemodel (= 4.1.0) + activerecord (= 4.1.0) + activesupport (= 4.1.0) + bundler (>= 1.3.0, < 2.0) + railties (= 4.1.0) + sprockets-rails (~> 2.0) + railties (4.1.0) + actionpack (= 4.1.0) + activesupport (= 4.1.0) rake (>= 0.8.7) - rdoc (~> 3.4) - thor (>= 0.14.6, < 2.0) - rake (10.1.0) - rdoc (3.12.2) - json (~> 1.4) - ruby-hmac (0.4.0) - sass (3.2.5) - sass-rails (3.2.6) - railties (~> 3.2.0) - sass (>= 3.1.10) - tilt (~> 1.3) - sprockets (2.2.2) + thor (>= 0.18.1, < 2.0) + rake (10.3.2) + sass (3.2.19) + sass-rails (4.0.3) + railties (>= 4.0.0, < 5.0) + sass (~> 3.2.0) + sprockets (~> 2.8, <= 2.11.0) + sprockets-rails (~> 2.0) + sprockets (2.11.0) hike (~> 1.2) multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) - sqlite3 (1.3.7) - thin (1.5.0) + sprockets-rails (2.1.3) + actionpack (>= 3.0) + activesupport (>= 3.0) + sprockets (~> 2.8) + sqlite3 (1.3.9) + thin (1.6.2) daemons (>= 1.0.9) - eventmachine (>= 0.12.6) + eventmachine (>= 1.0.0) rack (>= 1.0.0) - thor (0.18.1) + thor (0.19.1) + thread_safe (0.3.4) tilt (1.4.1) - treetop (1.4.14) + treetop (1.4.15) polyglot polyglot (>= 0.3.1) - tzinfo (0.3.37) - uglifier (1.3.0) + tzinfo (1.2.1) + thread_safe (~> 0.1) + uglifier (2.5.1) execjs (>= 0.3.0) - multi_json (~> 1.0, >= 1.0.2) - warden (1.2.1) + json (>= 1.8.0) + warden (1.2.3) rack (>= 1.0) PLATFORMS @@ -140,12 +152,13 @@ PLATFORMS DEPENDENCIES asset_sync - coffee-rails (~> 3.2.1) + coffee-rails devise jquery-rails pg - rails (= 3.2.13) - sass-rails (~> 3.2.3) + protected_attributes + rails (= 4.1.0) + sass-rails (~> 4.0.3) sqlite3 thin uglifier (>= 1.0.3) diff --git a/app/controllers/jsonuser_controller.rb b/app/controllers/jsonuser_controller.rb index 3565944..2c80d9f 100644 --- a/app/controllers/jsonuser_controller.rb +++ b/app/controllers/jsonuser_controller.rb @@ -3,14 +3,14 @@ def create respond_to do |format| format.html { super } format.json { - build_resource + build_resource(devise_parameter_sanitizer.sanitize(:sign_up)) if resource.save if resource.active_for_authentication? - sign_in(resource_name,resource) + sign_up(resource_name,resource) render :status => 200, :json => { :error => "Success", :message => "Logged in" } else - expire_session_data_after_sign_in! + expire_data_after_sign_in! render :status => 200, :json => { :error => "Success", :message => "Not logged in" } end else diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb index a5c4585..36670f9 100644 --- a/app/views/devise/mailer/confirmation_instructions.html.erb +++ b/app/views/devise/mailer/confirmation_instructions.html.erb @@ -1,5 +1,5 @@ -
Welcome <%= @resource.email %>!
+Welcome <%= @email %>!
You can confirm your account email through the link below:
-<%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %>
+<%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @token) %>
diff --git a/app/views/devise/mailer/reset_password_instructions.html.erb b/app/views/devise/mailer/reset_password_instructions.html.erb index ae9e888..f667dc1 100644 --- a/app/views/devise/mailer/reset_password_instructions.html.erb +++ b/app/views/devise/mailer/reset_password_instructions.html.erb @@ -1,8 +1,8 @@Hello <%= @resource.email %>!
-Someone has requested a link to change your password, and you can do this through the link below.
+Someone has requested a link to change your password. You can do this through the link below.
-<%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %>
+<%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %>
If you didn't request this, please ignore this email.
Your password won't change until you access the link above and create a new one.
diff --git a/app/views/devise/mailer/unlock_instructions.html.erb b/app/views/devise/mailer/unlock_instructions.html.erb index 2263c21..41e148b 100644 --- a/app/views/devise/mailer/unlock_instructions.html.erb +++ b/app/views/devise/mailer/unlock_instructions.html.erb @@ -1,7 +1,7 @@Hello <%= @resource.email %>!
-Your account has been locked due to an excessive amount of unsuccessful sign in attempts.
+Your account has been locked due to an excessive number of unsuccessful sign in attempts.
Click the link below to unlock your account:
-<%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) %>
+<%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %>
diff --git a/config/environments/development.rb b/config/environments/development.rb index fbe0415..b749aa5 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -27,7 +27,7 @@ # Log the query plan for queries taking more than this (works # with SQLite, MySQL, and PostgreSQL) - config.active_record.auto_explain_threshold_in_seconds = 0.5 + # config.active_record.auto_explain_threshold_in_seconds = 0.5 # Do not compress assets config.assets.compress = false @@ -42,4 +42,6 @@ :port => "25", :domain => "ast-ssa.com" } + + config.eager_load = false end diff --git a/config/environments/test.rb b/config/environments/test.rb index 20b1f2a..e0c7c94 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -34,4 +34,6 @@ # Print deprecation notices to the stderr config.active_support.deprecation = :stderr + + config.eager_load = false end diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 243afb4..05f8cf4 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -12,6 +12,8 @@ # Automatically apply schema changes in tableless databases #config.apply_schema = false + config.secret_key = '958739a56119676a03ae87335d36a2401ff7e98a7dc9a9985e1f7317f8bbad13f066a3dbfc8bd12434ee03e973528e7068fd8d2f8c80ae0fb9858c0b17152b7e' + # ==> ORM configuration # Load and configure the ORM. Supports :active_record (default) and # :mongoid (bson_ext recommended) by default. Other ORMs may be diff --git a/config/routes.rb b/config/routes.rb index 2825c8d..f284f7e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -26,7 +26,7 @@ get '/confirm' => 'devise/confirmations#show' get '/pwd' => 'userupdate#edit', :as => :edit_pwd - put '/pwd' => 'userupdate#update_pwd', :as => :update_pwd + patch '/pwd' => 'userupdate#update_pwd', :as => :update_pwd end get '/assessments' => 'assessments#fetch', :as => :fetch_assessments