Mistakes I've made in Ruby and Rails

3,361 views
3,076 views

Published on

A short presentation on mistakes I've made during the years in ruby and rails

Published in: Technology

Mistakes I've made in Ruby and Rails

  1. Stupid things I’ve done
  2. Stupid things I’ve done In Ruby and Rails
  3. Bert Goethals
  4. Bert Goethals
  5. We all make mistakes That drink, that girl, the morning after That chicken, the biting, mom laughing her ass off
  6. But we learn Drink less or pass out Don’t pee on chickens
  7. Ruby and Rails
  8. 8 Mistakes for you to learn from
  9. acts_as_inherit
  10. Hacking rails to combine 2 models in one model
  11. • Modify default queries • Provide setters / getters for “inherited” attribbutes • Allow validation and errors on “inherited” attribbutes • All transparent
  12. Rails goes from 1.1 to 1.2
  13. • Modify default queries • Provide setters / getters for “inherited” attribbutes • Allow validation and errors on “inherited” attribbutes • All transparent
  14. Don’t hack rails internals
  15. acts_as_taggable _on_steroids
  16. Lot of overhead for a list of words • Two extra tables • SQL isn’t meant for search • ActiveRecord Model overload!
  17. Save the list of words • No extra query for tags • Search with Sphinx • Generate tagclouds separately
  18. Fighting ::NameSpaces
  19. REST principal But not always
  20. attr_protected and attr_accessible
  21. Controllers should control requests
  22. Flame shield Up!
  23. Prototype
  24. Use jQuery or MooTools
  25. Mephisto
  26. Anything else! or Wordpress (PHP)
  27. ActiveRecord
  28. ActiveRecord For batch processing
  29. ActiveRecord = Lots of memory Batch = Lots of stuff ActiveRecord + Batch = Lots and Lots of Memory
  30. Use DataMapper or write your own queries
  31. alias_attribute
  32. alias_attribute Not using it
  33.   def name     read_attribute(:title)   end     def name=(value)     write_attribute(:title, value)   end
  34.     alias_attribute :name, :title
  35. R.T.F.M.
  36. Conclusions and questions?

×