Public Lab Research note

  • 2

Upgrade Plot to Rails 4/Implementation of Facebook/Twitter Login

by siaw23 |

About Me

My name is Emmanuel Hayford. I am a Rails developer and a final year Computer Science student at the Wroclaw University of Science and Technology. I have been working with Ruby and Rails for about five years. Ruby is my go-to language. I program for fun and like working on projects, be it personal or commercial and more so if the project has something to do with Ruby. I am originally from Ghana but live in Poland. I also have practical knowledge on frontend frameworks like Angular and React and I am a fan of Test Driven Development and a strong advocate for clean, readable code.

Affiliation: Wroclaw University of Technology

Location: Wroclaw, Poland

Project description

I would like to upgrade Plots2 which is currently on Rails 3 to Rails 4. Rails 4 comes with a lot of added features and improvements that will come in handy to this project sooner or later. If time is on my side after the end of Google Summer of Code (GSoC), I would like to make a further upgrade to Rails 5.

Implementing Facebook and Twitter login is one feature I would like to work on together with the upgrade. The priority for GSoC will be to first upgrade to Rails 4 and implement Facebook/Twitter login. The upgrade to Rails 5 will be an extra that I can even do after GSoC.


Upgrade of Plots2 to Rails 4 and implementation of Facebook/Twitter login.


Rails 3 was released 7 years ago. Since then there have been a lot of security fixes and enhancements to the framework and the Ruby language itself. Rails 4 takes advantage of Ruby version >= 2.0.0. The problem this eliminates is the vulnerability of being DoS attacked. Recent versions of Ruby made changes that made sure symbols, which are extensively used in Rails apps are garbage collected. This reason to have Plots2 upgraded needs no justification in my opinion. If Plots2 is already fast, it doesn't hurt making it faster by leveraging the features that Rails 4 and 5 have introduced.

Repeated tasks like having to type in emails followed by password can be a reason for someone not to use a site at all. The extra process is redundant when we have tools like one-click log-in from Facebook, Twitter, Google and GitHub. Almost everyone has a Facebook or Twitter account now. And giving users a reason and an easier option to login will be a nice thing to have, not to mention that this improves UX overall.


May 8 - May 22 (3 Weeks)

Community Bonding Period: Even though I am slowly reading everything about Public Lab and its projects, I would use this period to meticulously read about the flow of development at Public Lab. In this period I will also make very tiny contributions by refactoring code if need be and making sure the Ruby Style Guideline is enforced, in the process I'll have enough time to thoroughly understand the codebase of Plots2.

May 30 - June 20 (4 weeks)

This period is what I will use to fully have Plots2 upgraded to Rails 4.

Week 1:

Upgrade by patch versions to monitor deprecation warnings. Currently we're on Rails 3.2.20. The last Rails 3.x version is Rails 3.2.22, reaching this version and fixing deprecation errors along the way will be the main task of the first week after which we can look to jumping to Rails 4.0.

Week 2:

Rails 3 has a rake task rake app:update that shoots up an interactive session to help with the upgrade. After bumping our Rails version to Rails 4. This task will be run to help us. All errors will be fixed in this week and the making sure all gems work with Ruby 2.0 as is the preferred Ruby version for Rails 4.

Week 3 & 4:

The last two weeks before the Rails 4 milestone achievement will be to correct and implement several changes that have been introduced in Rails 4 that concern Active Record, Active Model, Action Pack and Active Support. One example of such changes happens in the route.rb file where we currently have something like match 'home' => 'home#front' that need to be changed to get '/' => 'root#index' among several other updates/changes to complete the upgrade process.

June 26 - June 30 (1 week)

Phase 1 evaluations.

July 3 - July 24 (3 weeks)

Implementation of Facebook and Twitter login.

Week 1:

Facebook login implementation happens here. I am going to use two main gems to implement this. Namely omniauth and omniauth-facebook probably. The User model will be update accordingly to make way for this new feature.

Week 2:

Twitter login implementation will take up the second week. Here we'll use omniauth, twitter and omniauth-twitter gems.

Week 3:

Catching up on implementations just in case I couldn't finish them. But I will try as hard as possible to finish the above tasks in time so I can take time of this week. Partying in celebration of the successes.

July 24 - July 30 (1 weeks)

Phase 2 evaluations.

July 31 - August 25 (4 weeks)

Attempt to upgrade from Rails 4 to Rails 5. In this period I will also try to catch up on things that I might not have completed previously. I doubt there'll be such a case because I would use my community bonding period to do some little work in advance.

August 25 - August 29 (1 week)

Submission of all deliverables: Upgraded applicatication, Implementation of Facebook/Twitter login.

August 29 - September 5 (1 week)

Final evaluation from mentor.


Usually open source projects leverage other open source resources. I won't need any extra resource except the time of my mentor in completing these tasks.


Forked project but running it locally. Not running on the Cloud9. I sent a request to get invited to Cloud9. However I feel more comfortable running everything locally. This is a link to my forked project.


Last year during GSoC, I upgraded Harvard University's Project Lumen (from Rails 3 to Rails 4). The Lumen Database is a Rails application that collects and analyzes legal complaints and requests for removal of online materials, helping Internet users to know their rights and understand the law. This app works in concert with Twitter and Google as far as content is concerned. I fixed a bunch of security holes in the app. Most of these security fixes were related to bad implementation of Regex. I gained a lot of experience on that legacy system that I can apply to help Plots2.

I have worked also professionally as a Rails Developer either as an intern or short stints on real Rails apps with thousands of paying customers. Aside that I have a couple of Rails apps that I play with on my GitHub and a lot of other apps that I have since removed from GitHub.


The tools we usually used were GitHub, Skype and Slack, just to name a few of the the means I used for communication with my team. I was usually solving issues and submitting them while scheduling a time to discuss my changes/additions with my mentor and seeking advice at the same time when I needed. Self motivation came from being able to solve tasks and getting the approval from my mentor. My main aim is to strive for completing tasks and striking out "to-dos" brings me satisfaction. Considering that most documentation is in English, self sufficiency has never been a problem.


I am more interested in the technology stack of Plots2. The frameworks, languages and tools you use are stuff I love and work with on a daily basis. It's exciting to continue developing oneself in the skill one knows already. I can't see anything more exciting that that.


Since Public Lab is a community trying to democratize science to address environmental issues that affect people, I would like my contribution to have a positive impact on all of its stakeholders by improving the tools used for collaborative knowledge-exchange.


Summer is usually a free period for most full-time students. This is not different with me. I have three months to my disposal and I would like to make meaningful use of it.

software gsoc gsoc-2017 soc soc-2017 rgsoc-2017 soc-2017-proposals



@warren @liz please let me know if someone is actively working on this, if not then i'll submit a full proposal.

Hi, Siaw23 - there is one attempt in particular that's been started, but I haven't seen updates on it recently so it's possible this is still in progress:

Have you been able to open a pull request and commit a change? We really appreciate seeing that folks are comfortable with the Github Flow process and with working through the PR process, even for a simple issue. Thanks!

@warren hello. I have seen that. i suggested it considering there's been no update on that thread. if he's still doing it then we can forget about this proposal. if not i'd like to take it on :)

also i have forked the project and looked through the issues/PRs and most of my ideas are being worked on. i'm a fan of clean and readable code. i suggested we follow ruby style guidelines since the project has a lot of violations. i'm working on it currectly as an extra responsibility :)

@warren updated. btw this editor needs a lot of work.

Hi, thanks for your proposal; apologies for the slow response, it's been a busy time of year and we've had a lot of submissions -- I'm usually faster at writing back.

I think the Rails upgrade is a reasonable proposal, especially in combination with the OAuth work, and like your proposed timeline and milestones. This sounds great!

Thanks for your patience! I'm also hoping to take a look at your PR on the style guide changes; hopefully we can get that rebased and merged.

@siaw23 Can you provide links of your contributions in the proposal if you still haven't submitted your final proposal. It can be Work in Progress but please include any contributions you made.

@ananyo2012 i have already submitted my final proposal. but i have started working on something like this and I plan to have them implemented throughout the codebase.

You must be logged in to comment.