+ All Categories
Home > Technology > Mistakes

Mistakes

Date post: 22-Jun-2015
Category:
Upload: arrrrcamp
View: 277 times
Download: 1 times
Share this document with a friend
Popular Tags:
36
Stupid things I’ve done
Transcript
Page 1: Mistakes

Stupid things I’ve done

Page 2: Mistakes

Stupid things I’ve doneIn Ruby and Rails

Page 3: Mistakes

Bert Goethals

Page 4: Mistakes

Bert Goethals

Page 5: Mistakes

We all make mistakes

That drink, that girl, the morning after

That chicken, the biting, mom laughing her ass off

Page 6: Mistakes

But we learn

Drink less or pass out

Don’t pee on chickens

Page 7: Mistakes

Ruby and Rails

Page 8: Mistakes

8Mistakes for you to learn from

Page 9: Mistakes

acts_as_inherit

Page 10: Mistakes

Hacking rails to combine 2 models in

one model

Page 11: Mistakes

• Modify default queries

• Provide setters / getters for “inherited” attribbutes

• Allow validation and errors on “inherited” attribbutes

• All transparent

Page 12: Mistakes

Rails goes from 1.1 to 1.2

Page 13: Mistakes

• Modify default queries

• Provide setters / getters for “inherited” attribbutes

• Allow validation and errors on “inherited” attribbutes

• All transparent

Page 14: Mistakes

Don’t hack rails internals

Page 15: Mistakes

acts_as_taggable_on_steroids

Page 16: Mistakes

• Two extra tables

• SQL isn’t meant for search

• ActiveRecord Model overload!

Lot of overhead for a list of words

Page 17: Mistakes

Save the list of words• No extra query for tags

• Search with Sphinx

• Generate tagclouds separately

Page 18: Mistakes

Fighting ::NameSpaces

Page 19: Mistakes

REST principalBut not always

Page 20: Mistakes

attr_protectedand

attr_accessible

Page 21: Mistakes

Controllers should control requests

Page 22: Mistakes

Flame shield Up!

Page 23: Mistakes

Prototype

Page 24: Mistakes

Use jQueryor MooTools

Page 25: Mistakes

Mephisto

Page 26: Mistakes

Anything else!or Wordpress (PHP)

Page 27: Mistakes

ActiveRecord

Page 28: Mistakes

ActiveRecordFor batch processing

Page 29: Mistakes

ActiveRecord = Lots of memoryBatch = Lots of stuff

ActiveRecord + Batch = Lots and Lots of Memory

Page 30: Mistakes

Use DataMapperor write your own queries

Page 31: Mistakes

alias_attribute

Page 32: Mistakes

alias_attributeNot using it

Page 33: Mistakes

  def name    read_attribute(:title)  end   def name=(value)    write_attribute(:title, value)  end

Page 34: Mistakes

    alias_attribute :name, :title

Page 35: Mistakes

R.T.F.M.

Page 36: Mistakes

Conclusionsand questions?


Recommended