• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Mistakes I've made in Ruby and Rails
 

Mistakes I've made in Ruby and Rails

on

  • 5,216 views

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

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

Statistics

Views

Total Views
5,216
Views on SlideShare
5,196
Embed Views
20

Actions

Likes
6
Downloads
75
Comments
0

2 Embeds 20

http://www.slideshare.net 19
http://www.nexres.org 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />

Mistakes I've made in Ruby and Rails Mistakes I've made in Ruby and Rails Presentation Transcript

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