Make this code better

  • Avoiding a lot of ifs in Ruby 1 reactions

    I have a serious nesting of ifs in a helper code and I would like to making cleaner. I would like to avoid case if possible as well. I know there is probably a more Object-Oriented approach to this but I can't seem to know how.

    Pedro Nascimento about 5 years ago
  • Getting the right object value from a Doctrine Collection object 4 reactions

    I have a m-m relationship between 'room' and 'guest' with a join table in the middle called 'booking'. Columns in the 'booking' join table are room_id, guest_id and dateIn, dateOut to record when a guest is booked in/ out of the room. I have a method that gets a Doctrine (1.2) collection of all

    Tocacar about 5 years ago
  • PDO Data Model 5 reactions

    This is a basic PDO Data Model that I'm curious if there was a way to make it any better.

    Jacques Woodcock about 5 years ago
  • [Sample Entry] My Validation Script 9 reactions

    This is a sample code I use for my Object Calisthenics talk, which is where this website was born (read about page). Its a trivial code but it can be made better and simpler, easier to read and even faster. So to give you an idea of how to use this website, i'll be posting the code and fixing it mys

    Rafael Dohms about 5 years ago