Your SlideShare is downloading. ×
0
Além do Active Record
@HANNELITA                           a.k.a Hanneli• Desenvolvedora       @• Fanática   por café (especialmente do Starbuck...
Rails
MySQLRails
PROBLEM?
Uh-oh. Exciting.
class User < ActiveRecord::Base   has_many :friends, :dependent => :destroy  has_many :contacts,           :through => :fr...
class Friend < ActiveRecord::Base   belongs_to :user  belongs_to :contact,              :class_name => "User",            ...
IdIdIdId
IdIdIdId
HOMEWORKImplemente as relações de follow,   follower, followed_by, etc.
YES, YOU CAN
REDIS
VANTAGENS• Menos   código• Legibilidade• Velocidade   na busca
• Sim, é   só escrever código Ruby.• Prazer, initializer, acho   que você já me conhece.
RAILS 3
RAILS 3: THE GREAT  DECOUPLING
ActiveRecord
NEO4J
NOT ONLY
rails new seuProjeto -m http://andreasronge.github.com/rails3.rb
YES, IT WORKS.
• CouchDB• Cassandra• Mongo• Riak
PERGUNTAS?
OBRIGADA!• hannelita@gmail.com   - Gtalk• @hannelita
Rails - além do Active Record
Rails - além do Active Record
Rails - além do Active Record
Rails - além do Active Record
Rails - além do Active Record
Rails - além do Active Record
Rails - além do Active Record
Rails - além do Active Record
Rails - além do Active Record
Rails - além do Active Record
Rails - além do Active Record
Rails - além do Active Record
Rails - além do Active Record
Rails - além do Active Record
Rails - além do Active Record
Rails - além do Active Record
Upcoming SlideShare
Loading in...5
×

Rails - além do Active Record

1,391

Published on

Slides da minha apresentação na trilha de Ruby no TDC2011 - 08/07/2011

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,391
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • rails -m http://jruby.org/rails3.rb&apos;\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Each user has a list of IDs that represent the people that they are friends with.\nrefers to the same table with two different names\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • tirar AR\ncolocar um nosql...\nfeito pra java?\n
  • http://andreasronge.github.com/rails3.rb\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript of "Rails - além do Active Record"

    1. 1. Além do Active Record
    2. 2. @HANNELITA a.k.a Hanneli• Desenvolvedora @• Fanática por café (especialmente do Starbucks)• Alucinada por TI• Viciada em codar• Universitária• etc
    3. 3. Rails
    4. 4. MySQLRails
    5. 5. PROBLEM?
    6. 6. Uh-oh. Exciting.
    7. 7. class User < ActiveRecord::Base  has_many :friends, :dependent => :destroy has_many :contacts, :through => :friends, :order => "created_at DESC", :dependent => :destroy end
    8. 8. class Friend < ActiveRecord::Base  belongs_to :user belongs_to :contact, :class_name => "User", :foreign_key => "contact_id"  def self.befriend(user, contact) relationship =find_by_user_id_and_contact_id(user.id,friend.id) if relationship.nil? transaction do Friend.create(:user => user, :contact => contact) end end end end
    9. 9. IdIdIdId
    10. 10. IdIdIdId
    11. 11. HOMEWORKImplemente as relações de follow, follower, followed_by, etc.
    12. 12. YES, YOU CAN
    13. 13. REDIS
    14. 14. VANTAGENS• Menos código• Legibilidade• Velocidade na busca
    15. 15. • Sim, é só escrever código Ruby.• Prazer, initializer, acho que você já me conhece.
    16. 16. RAILS 3
    17. 17. RAILS 3: THE GREAT DECOUPLING
    18. 18. ActiveRecord
    19. 19. NEO4J
    20. 20. NOT ONLY
    21. 21. rails new seuProjeto -m http://andreasronge.github.com/rails3.rb
    22. 22. YES, IT WORKS.
    23. 23. • CouchDB• Cassandra• Mongo• Riak
    24. 24. PERGUNTAS?
    25. 25. OBRIGADA!• hannelita@gmail.com - Gtalk• @hannelita
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×