• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Rails - Além do Active Record - TDC2011 Floripa
 

Rails - Além do Active Record - TDC2011 Floripa

on

  • 742 views

Slides da minha apresentação no TDC2011 de Floripa

Slides da minha apresentação no TDC2011 de Floripa

Statistics

Views

Total Views
742
Views on SlideShare
734
Embed Views
8

Actions

Likes
0
Downloads
2
Comments
0

2 Embeds 8

http://www.linkedin.com 6
http://www.hanrss.com 2

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
  • \n
  • \n
  • \n
  • \n
  • rails -m http://jruby.org/rails3.rb'\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
  • \n
  • \n
  • tirar AR\ncolocar um nosql...\nfeito pra java?\n
  • http://andreasronge.github.com/rails3.rb\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Rails - Além do Active Record - TDC2011 Floripa Rails - Além do Active Record - TDC2011 Floripa Presentation Transcript

  • Além do Active Record
  • @HANNELITA a.k.a Hanneli• Desenvolvedora• Fanática por café (especialmente do Starbucks)• Open Source• Viciada em codar• Universitária
  • Rails
  • MySQLRails
  • PROBLEM?
  • Uh-oh. Exciting.
  • class User < ActiveRecord::Base  has_many :friends, :dependent => :destroy has_many :contacts, :through => :friends, :order => "created_at DESC", :dependent => :destroy end
  • 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
  • IdIdIdId
  • IdIdIdId
  • HOMEWORKImplemente as relações de follow, follower, followed_by, etc.
  • YES, YOU CAN
  • REDIS
  • NOSQL
  • 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• http://hannelita.wordpress.com