• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Mistakes
 

Mistakes

on

  • 464 views

 

Statistics

Views

Total Views
464
Views on SlideShare
464
Embed Views
0

Actions

Likes
0
Downloads
2
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

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

    Mistakes Mistakes 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?