ltfschoen / littlehumans

Medical Portal App for Midwives developed with Ruby on Rails, Google Calendar, OmniAuth2, and PostgreSQL
http://littlehumans.herokuapp.com/
0 stars 0 forks source link

Duplicated code in User model #14

Closed mikel closed 10 years ago

mikel commented 10 years ago

There's a lot of duplicated code in the user model. Many lines are exactly the same as others, try refactoring this into some common methods and extracting only what is different between the auth models

ltfschoen commented 10 years ago

Refactored User Model with User Helper Module. Changes pushed with branch named "feature/7_usermodel_v2".

Note that I also added Active Record Store Gem instead of Cookie Store. Initially I did this because I was getting a cookie overflow error, however I refactored the code to avoid the 4kb limit later anyway. Note additionally, that originally I attempted to solve this issue by performing an SOA Implementation, however I was unable to overcome errors and therefore have not pushed the code. I basically followed the following guide to and implemented module namespace abstraction layers for classes within folder categories including physical, logic, services (intention was to refactor the OAuth, Google Calendar, and Twitter Feed Request code into this API Services category), and utility: Setup was performed following this guide: http://enterpriserails.chak.org/full-text/chapter-3-organizing-with-modules