A (more) complete cheatsheet for Arel, including NamedFunction functions, raw SQL and window functions.
posts = Arel::Table.new(:posts)
posts = Post.arel_table # ActiveRecord| // ©2012 Viktor Klang | |
| package akka.klang | |
| import akka.dispatch.{ DispatcherPrerequisites, ExecutorServiceFactory, ExecutorServiceConfigurator } | |
| import com.typesafe.config.Config | |
| import java.util.concurrent.{ ExecutorService, AbstractExecutorService, ThreadFactory, TimeUnit } | |
| import java.util.Collections | |
| import javax.swing.SwingUtilities |
| /* global module:false */ | |
| module.exports = function(grunt){ | |
| grunt.initConfig({ | |
| pkg: '<json:package.json>', | |
| meta: { | |
| banner: '/*! <%= pkg.name %> */' | |
| }, | |
| server: { | |
| base: '.', | |
| port: 9999 |
| Welcome to Scala version 2.10.3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_25). | |
| Type in expressions to have them evaluated. | |
| Type :help for more information. | |
| scala> val map0 = Map.empty[Int, Int] withDefaultValue 0 | |
| map0: scala.collection.immutable.Map[Int,Int] = Map() | |
| scala> val map1 = map0 mapValues(identity) | |
| map1: scala.collection.immutable.Map[Int,Int] = Map() |
| all: libsudoku.js sudoku.js sudoku | |
| clean: | |
| rm -f libsudoku.js sudoku.js sudoku | |
| rm -f libsudoku.js.map sudoku.js.map | |
| rm -f libsudoku.js.mem sudoku.js.mem | |
| # library for using functions in hand written JavaScript code | |
| libsudoku.js: libsudoku.c | |
| emcc -g4 -Wall -Wextra -std=c11 $^ -o $@ \ | |
| -s EXPORTED_FUNCTIONS="['_output', '_sudoku']" \ |
| module ArelHelpers | |
| extend self | |
| def self.included(base) | |
| base.extend self | |
| end | |
| def asterisk(arel_table_or_model) | |
| arel_table, columns = case arel_table_or_model | |
| when Arel::Table |