4
votes
1answer
61 views

How could this “complex method” for codeclimate be refactored?

I'm trying to figure out how to refactor some code based on what codeclimate is telling me. So far it seems that any method that is longer than 5 lines or has an ...
1
vote
1answer
47 views

Better way of comparing integers

I wrote this class which is comparing some values, how can I improve its performance and maybe make it prettier? You can see at the bottom what type of data it requires, also the array size can reach ...
1
vote
1answer
52 views

Is my code clean enough and standard when processing Ruby on Rails requests using User's time zone?

I have an application in Ruby on Rails (3.2) and I want all the requests to take into account the currently logged in user's time zone. Also, I want to have a helper that will let me display date ...
2
votes
1answer
46 views

Task observer implementation

I need help cleaning up this piece of code. ...
1
vote
0answers
58 views

Date and time columns conversion to Time(WithZone)

I got 2 columns representing a date and a time. {dateproc: '2012-03-23', horproc: '2000-01-01 16:15:23 UTC'} Both are read as a TimeWithZone by rails. I need to ...