Skip to content
View ecto-belongs-to-issue.exs
defmodule BelongsToReferenceKeyTest do
use ExUnit.Case
defmodule Foo do
use Ecto.Model
@primary_key {:foobar_id, :id, []}
schema "foos" do
belongs_to :bar, Bar
View gist:6d8e3377a76c2ce7ded7
foo([{:a, [1, 2], [:b]}, {c, [3, 4], [:d]}])
defp foo({:a, _, _} = bar, other})
defp foo(a, b) when a = {:a, _, _}
View query_controller.ex
defmodule MyApp.EventController do
use MyApp.Web, :controller
import Ecto.Query
alias MyApp.Event
alias MyApp.EventSerializer
plug :scrub_params, "event" when action in [:create, :update]
def index(conn, params) do
View authenticator.ex
defmodule MyApp.Authenticator do
import Plug.Conn
def attempt_to_authenticate(conn, _) do
case find_account(conn) do
{ :ok, account } ->
assign(conn, :account, account)
:error ->
|> send_resp(401, "")
  1. Part 1
    1. Setting up Your Development Environment
      1. Installing Node && npm
        1. Node for OSX
        2. Node for Linux
        3. Node for Windows
      2. Installing Bower
      3. Installing PhantomJS
      4. Installing Ember-CLI
        1. Generate a project
View promise.js
certificates: computed(function() {
return PromiseManyArray.create({
promise:'transfer', { user_id: get(this, 'id') })
.then(records => {
// this.notifyPropertyChange('certificates');
return records;
View unroundedFixed.js
function unroundedFixed(number, precision) {
let [left, right] = number.toString().split('.');
[right] = right.match(new RegExp(`[0-9]{${precision}}`));
return [left, right].join('.');
View session_controller.ex
defmodule SogApi.SessionController do
use SogApi.Web, :controller
import Comeonin.Bcrypt
import SogApi.Authenticator
alias SogApi.Account
alias SogApi.AccountSerializer
plug :attempt_to_authenticate, "before delete" when action in [:delete, :show]
Something went wrong with that request. Please try again.