4. 6 razones por las que debes usar rails
y algunas por las que NO deberías
5. Ruby hace a los
programadores poderosos
felices.
6. Algunas personas piensan que es
demasiado...
"1".to_i
#=> 1
class String
def to_i
raise 'foobar'
end
end
"1".to_i
#=> RuntimeError: foobar
class String
def to_i
self.to_f - 1.13
end
end
"2".to_i
#=> 0.8700000000000001
14. Problem? Integrado? Hay gema? Gema/s
Paginación N/A Si Kaminari, will_paginate
Autenticación Si Device, Authlogic, Omniauth
Autorización Si CanCan
Test auto-generados Si Shoulda
Dependency-Management Si Si Bundler
Background-jobs N/A Si Resque, sidekiq, delayed_job
Minificar JS y CSS Si Jammit
Simular interaction real usuarios Si capybara
ecommerce Si Active Merchant
Deployment Si Si Passenger,
Better error management Si Si Better_errors
Email management Si Si Letter_opener,
Everything else Probably
17. Scoping
class Shirt < ActiveRecord::Base
named_scope :red, :conditions => {:color => 'red'}
named_scope :dry_clean_only, :joins =>
:washing_instructions,:conditions
=> ['washing_instructions.dry_clean_only = ?', true]
end
Si llamamos Shirt.red esto hara un query a la base de datos con la condicion "color = 'red'"
La parte genial es que si combinamos mas de un parámetro ej:
Shirt.red.dry_clean_only
este va a construir un solo query, con todas las condiciones y todos los joins necesarios en la base de
datos.
21. 1. Performance (Fixed with ruby 3)
2. Aplicaciones/bases de datos existentes
3. Requires extensive code-review
4. Tal Vez pierda popularidad en el futuro
5. NO es para principiantes (demasiada magia)
Rails es uno de los frameworks mas subestimados, al mismo tiempo , es uno de los frameworks que se adapta mas fácilmente a un desarrollo agile.
*rails personal experience with socialyte*
me sorprende que en intellisys siendo tan agile no se utilize mas ruby on rails
Talvez creas que tener a un junior en el equipo con tanto poder pueda ser peligroso, pero en el mundo real, estos casos no suceden
ITS LIKE DRIVING A CAR. nadie maneja un carro a 300km/h
One of the early productivity mottos of Rails went: “You’re not a beautiful and unique snowflake”. It postulated that by giving up vain individuality, you can leapfrog the toils of mundane decisions, and make faster progress in areas that really matter.Who cares what format your database primary keys are described by? Does it really matter whether it's “id”, “postId”, “posts_id”, or “pid”? Is this a decision that’s worthy of recurrent deliberation? No.