A (more) complete cheatsheet for Arel, including NamedFunction functions, raw SQL and window functions.
posts = Arel::Table.new(:posts)
posts = Post.arel_table # ActiveRecord| /* | |
| Hoje não deixaremos mais ninguém no vácuo no whatsapp | |
| Para utilizar: | |
| - Abra o web.whatsapp.com; | |
| - Abra o console e cole o código que está no gist; | |
| - Aguarde e verá uma mensagem sendo enviada a cada momento que alguém te enviar alguma mensagem. | |
| Confira também como ser chato no whatsapp: https://gist.github.com/mathloureiro/4c74d60f051ed59650cc76d1da0d32da | |
| e como ser chato no mensseger: https://gist.github.com/mathloureiro/d3f91d19cf148838217e42a0c6df5ed8 | |
| */ |
| - (NSURL *)URLWithString:(NSString *)string andQueryValuesForKeys:(NSString *)value, ... { | |
| if (!value) { | |
| return [NSURL URLWithString:string]; | |
| } | |
| NSMutableString *queryString = [NSMutableString string]; | |
| NSString *argument = nil; | |
| NSUInteger argumentCount = 0; | |
| va_list argumentList; |
| require 'rubygems' if RUBY_VERSION < '1.9' | |
| require 'tempfile' | |
| require File.join(ENV['JETPAC_PATH'], 'library/logger') | |
| require File.join(ENV['JETPAC_PATH'], 'library/email') | |
| def image_command(command) | |
| log "IMG: Running '#{command}'" | |
| result = system(command) | |
| if !result |