Skip to content

Instantly share code, notes, and snippets.

defmodule CustomPK.Repo.Migrations.CreateParent do
use Ecto.Migration
def change do
create table(:parent, primary_key: false) do
add :parent_id, :integer, primary_key: true
add :parent_code, :text, null: false
add :settings, :text
timestamps()
end
data = %MyStruct{
arg1: "val",
arg2: "val"
}
HTTPoison.start
HTTPoison.post("http://localhost:8200/v1/post/#{datasource}", Poison.encode(data))
HTTPoison.stop
defmodule MyApp.Mixfile do
use Mix.Project
def project do
[app: :my_app
......
aliases: aliases()]
end
class EoiPolicy < ApplicationPolicy
class Scope
attr_reader :user, :scope
def initialize(user, scope)
@user = user
@scope = scope
end
** (exit) exited in: :gen_server.call(#PID<0.1055.0>, {:checkout, #Reference<0.0.6.4309>, true, :infinity}, 5000)
** (EXIT) an exception was raised:
** (ArithmeticError) bad argument in arithmetic expression
(logger) lib/logger/utils.ex:22: Logger.Utils.truncate_n/2
(logger) lib/logger/utils.ex:46: Logger.Utils.truncate_n_list/3
(logger) lib/logger/utils.ex:13: Logger.Utils.truncate/2
(logger) lib/logger.ex:450: Logger.bare_log/3
(db_connection) lib/db_connection/connection.ex:150: DBConnection.Connection.connect/2
(connection) lib/connection.ex:622: Connection.enter_connect/5
(stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
=ERROR REPORT==== 11-Aug-2016::10:21:41 ===
** Generic server schedule_ingestor terminating
** Last message in was fetch_schedule_data
** When Server state == #{timer => #Ref<0.0.4.267>}
** Reason for termination ==
** {{case_clause,{nil,100,0,nil}},
[{'Elixir.Stream',do_resource,5,[{file,"lib/stream.ex"},{line,1099}]},
{'Elixir.Stream',run,1,[{file,"lib/stream.ex"},{line,494}]},
{'Elixir.MyGenServer',
handle_info,2,
defmodule MyServer do
def ack(conn, frame) do
GenServer.cast(conn, { :acknowledge, frame })
end
def register_callback(conn, destination, callback) do
GenServer.call(conn, { :register_callback, destination, callback })
end
defmodule TGFeedIngestor.PollingIngestor do
use GenServer
def start_link do
{ :ok, pid } = :gen_server.start_link(__MODULE__, [], [])
end
def init(state) do
{ :ok, state }
end
defmodule Inova.Mixfile do
use Mix.Project
def project do
[app: :inova,
version: "0.0.1",
elixir: "~> 1.0",
elixirc_paths: elixirc_paths(Mix.env),
compilers: [:phoenix, :gettext] ++ Mix.compilers,
build_embedded: Mix.env == :prod,
** (UndefinedFunctionError) undefined function Canada.Can.can?/3 (module Canada.Can is not available)
Canada.Can.can?(%Inova.User{__meta__: #Ecto.Schema.Metadata<:loaded>, api_tokens: #Ecto.Association.NotLoaded<association :api_tokens is not loaded>, athletes: #Ecto.Association.NotLoaded<association :athletes is not loaded>, avatar: nil, biometric: #Ecto.Association.NotLoaded<association :biometric is not loaded>, coach: #Ecto.Association.NotLoaded<association :coach is not loaded>, coach_id: nil, country: nil, dob: nil, email: "1", forename: "Qq", gender: nil, height: nil, id: 1, inserted_at: #<DateTime(2016-05-10T21:43:32Z)>, password: nil, password_confirmation: nil, salt: "uk3aWLBTWHmHaHWlKXi9.w", surname: "a", updated_at: #<DateTime(2016-05-10T21:43:32Z)>, user_type: "coach", weight: nil}, :create, Inova.Workout)
(canary) lib/canary/plugs.ex:206: Canary.Plugs._authorize_resource/2
(canary) lib/canary/plugs.ex:186: Canary.Plugs.authorize_resource/2
(canary) lib/canary/plug