This file contains hidden or 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
%{"email" => "[email protected]", "password" => "password"} |
This file contains hidden or 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
defmodule NonResource do | |
defstruct id: nil, prop1: "prop1", prop2: "prop2" | |
end | |
defimpl Canada.Can, for: NonResource do | |
def can?(%User{ id: user_id }, action, _) do | |
... | |
end | |
end |
This file contains hidden or 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
defimpl Canada.Can, for: Company do | |
def can?(%User{ id: user_id }, :update, %Company{}), do: true | |
end |
This file contains hidden or 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
** (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 |
This file contains hidden or 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
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, |
This file contains hidden or 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
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 |
This file contains hidden or 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
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 | |
This file contains hidden or 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
=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, |
This file contains hidden or 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
** (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 |
This file contains hidden or 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
class EoiPolicy < ApplicationPolicy | |
class Scope | |
attr_reader :user, :scope | |
def initialize(user, scope) | |
@user = user | |
@scope = scope | |
end |
OlderNewer