This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# More "proper" than a miniskirt (http://gist.github.com/273579). | |
class Minidress | |
@@factories = {} | |
class << self | |
def define(name, &block) | |
@@factories[name.to_s] = block | |
end | |
def build(name, attrs = {}) | |
new(name.to_s.classify.constantize.new, &@@factories[name.to_s]).record |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Factory girl, relaxed. | |
# | |
# Factory.define :user do |f| | |
# f.login 'johndoe%d' # Sequence. | |
# f.email '%{login}@example.com' # Interpolate. | |
# f.password f.password_confirmation('foobar') # Chain. | |
# end | |
# | |
# Factory.define :post do |f| | |
# f.user { Factory :user } # Blocks, if you must. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://pastie.org/783420. | |
// view the full video at: | |
// http://jquery14.com/day-05/jquery-1-4-hawtness-1-with-paul-irish | |
/* d8b .d88888b. d888 d8888 | |
Y8P d88P" "Y88b d8888 d8P888 | |
888 888 888 d8P 888 | |
8888 888 888 888 888 .d88b. 888d888 888 888 888 d8P 888 | |
"888 888 888 888 888 d8P Y8b 888P" 888 888 888 d88 888 | |
888 888 Y8b 888 888 888 88888888 888 888 888 888 8888888888 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe Member::GraffitiesController do | |
context "A anonymous user" do | |
it "denies access to create action" do | |
@controller.expects(:create).never | |
post :create, {:wall_id => 1} | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Directly copied from eycap-0.5.2 (thanks!) | |
# | |
# With these tasks you can: | |
# - dump your production database and save it in shared_path/db_backups | |
# - dump your production into your local database (clone_to_local) | |
# | |
# Right now is not tested without all the gem. Give me a moment to check it :-) | |
Capistrano::Configuration.instance(:must_exist).load do | |
namespace :db do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* 2010_06_26 - Cosillas Raras de Arel - https://rails.lighthouseapp.com/projects/8994/tickets/4841-multiple-select-only-keep-the-last-one | |
- Si usas varios select separados se concatenan Post.select("title").select("autor") | |
- Si usas varios order seaparados se concatenan Post.order("title").order("autor") | |
- Puedes utilizar reorder para sobreescribier Post.order("title").reorder("autor") | |
* 2010_06_09 - Al pareacer en i18n si se necesita un string html_safe la clave debe acabar en _html o en .html ActionView::Helpers::TranslationHelper doc | |
* 2010_04_10 - Fuera del core los helpers que pintan los errores ahora http://github.com/rails/dyanimic_form | |
* 2010_04_10 - Fuera del core de rails verify (in controllers) ahora http://github.com/rails/verification | |
* 2010_04_05 - Added all the new HTML5 form types as individual form tag methods (search, | |
url, number, etc) - http://github.com/rails/rails/commit/f8730e5ce6bba4de7639ac09c6c193458038f748#comments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Action Pack | |
* Remove metal from Rails3 [YK] | |
http://github.com/rails/rails/commit/45e60283e733a535d68d499aa20e095c905f43b0 | |
* :only and :except options in the use of rack middlewares [JV] | |
http://github.com/rails/rails/commit/9a93844aba44319d3c8487a554124beb00ccc267 | |
class PostsController < ApplicationController | |
use AutheMiddleware, :except => [:index, :show] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Factory.define :application do |factory| | |
factory.attachment(:sample, "public/samples/sample.doc", "application/msword") | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
es: | |
errors: | |
messages: | |
not_found: 'no encontrado' | |
already_confirmed: 'ya ha sido confirmada' | |
not_locked: 'no está bloqueada' | |
devise: | |
failure: | |
unauthenticated: 'Necesitas acceder a tu cuenta o registrarte antes de continuar.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Development | |
sudo apt-get install bash-completion autoconf tig meld curl subversion git-core git-svn git-cola gitg xchat postfix | |
# Chrome | |
http://google.com/chrome | |
# Sun Java | |
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" | |
sudo apt-get update | |
sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk |