CSC/ECE 517 Fall 2014/OSS E1464 vnn

From Expertiza_Wiki
Revision as of 18:30, 29 October 2014 by Nkatre (talk | contribs) (Created page with "= E1464: Refactoring User model = The requirements provided for the Open Source System project of Expertiza were as follows : <br> '''Classes''': <br> ''user.rb'' (295 lines)<br>...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

E1464: Refactoring User model

The requirements provided for the Open Source System project of Expertiza were as follows :
Classes:
user.rb (295 lines)

What they do:
This model helps the user log in and checks whether the user is a student, admin or a super admin. It also helps reset passwords and assign instrcutors to the user.

What is needed:

  • Writing proper getters/setters if necessary, otherwise remove getters/setters
  • Replacing inefficient boolean logic (`if true` is not conditional)
  • Replacing old-style ActiveRecord queries
  • Using {} and [] instead of Hash.new and Array.new
  • Not instantiating more than 1 instance variable per action