« Back to channel list

#elixir-lang - 07 April 2019

« Back 1 day Forward 1 day »
[00:00:21] wonko7: has joined #elixir-lang
[00:16:11] askadar: has left #elixir-lang: ()
[00:27:36] fyber7: I've tried (almost) every guide on Phoenix that I could find, but they all seem very out of date. (A lot of functions in Comeonin/Argon2 were renamed, the directory structure is different, Ecto doesn't have "model"s anymore, etc.)
[00:27:50] fyber7: Is there a guide somewhere that has the *current* best practices for the basics? Past that I can figure things out from documentation but right now I have no idea.
[00:29:30] iamvery: has joined #elixir-lang
[00:36:20] zblanco: has joined #elixir-lang
[00:38:37] lauromoura: has joined #elixir-lang
[00:46:29] Sgeo_: has joined #elixir-lang
[00:47:19] Rich_Morin: has joined #elixir-lang
[00:58:11] Rich_Morin: I'm confused about matching and capturing function parameters. For example, it seems like I should be able to write "def foo(n=1), do: f(n)" instead of "def foo(n) when n == 1, do: f(n)*. What am I missing?
[01:03:50] bhodgins: has joined #elixir-lang
[01:05:59] davidw: has joined #elixir-lang
[01:06:38] carldd: has joined #elixir-lang
[01:11:06] tomterl: has joined #elixir-lang
[02:03:01] starbelly: has joined #elixir-lang
[02:03:12] starbelly: ACTION keeps calm and beams on
[02:06:33] zigpaw: has joined #elixir-lang
[02:12:52] Rich_Morin: has joined #elixir-lang
[02:17:23] k1nd0f: has joined #elixir-lang
[02:20:52] ariedler: has joined #elixir-lang
[02:39:01] Rich_Morin: I'm (still :-) confused about matching and capturing function parameters. For example, it seems like I should be able to write "def foo(n=1), do: f(n)" instead of "def foo(n) when n == 1, do: f(n)". What am I missing?
[02:53:04] starbelly: If the syntax you think seems like the way it should be were true you would be rebinding 1 to n where is the latter is simply a clause evaluating n
[03:21:02] carldd: has joined #elixir-lang
[03:25:54] __charly__: has joined #elixir-lang
[03:55:42] k1nd0f: has joined #elixir-lang
[04:12:28] Rich_Morin: has joined #elixir-lang
[04:20:47] k1nd0f: has joined #elixir-lang
[04:22:16] ariedler: has joined #elixir-lang
[04:24:39] iamvery: has joined #elixir-lang
[04:46:25] KeyJoo: has joined #elixir-lang
[04:53:51] ariedler: has joined #elixir-lang
[05:06:44] wsieroci: has joined #elixir-lang
[05:07:33] Rich_Morin: has joined #elixir-lang
[05:08:20] Rich_Morin: has joined #elixir-lang
[05:09:09] Rich_Morin: has joined #elixir-lang
[05:09:55] Rich_Morin: has joined #elixir-lang
[05:10:38] Rich_Morin: has joined #elixir-lang
[05:11:26] Rich_Morin: has joined #elixir-lang
[05:12:12] Rich_Morin: has joined #elixir-lang
[05:13:03] Rich_Morin: has joined #elixir-lang
[05:14:33] za1b1tsu_: has joined #elixir-lang
[05:28:04] proteusguy: has joined #elixir-lang
[06:25:39] kapil____: has joined #elixir-lang
[06:27:17] squall: has joined #elixir-lang
[06:31:56] lexmag: has joined #elixir-lang
[07:00:51] cjk101010: has joined #elixir-lang
[07:03:53] gvaughn: has joined #elixir-lang
[07:04:55] ariedler: has joined #elixir-lang
[07:13:24] iamvery: has joined #elixir-lang
[07:17:54] thoth: has joined #elixir-lang
[07:27:52] InfinityFye: has joined #elixir-lang
[08:24:03] gvaughn: has joined #elixir-lang
[08:26:13] Rich_Morin: has joined #elixir-lang
[08:32:21] toothfairy__: I'm trying to pass a graphql filter argument from frontend through resolver in phoenix to the model, however I must be doing something fundamental error... Limit argument works but not the filter/swish argument, no errors but also no results ... Any ideas? https://dpaste.de/SSzg#L16,17
[08:41:59] PragTob: has joined #elixir-lang
[08:42:58] josevalim: Rich_Morin: inside a pattern, you can use `=` at any time to attach variables to parts of the pattern
[08:43:16] josevalim: def foo({:ok = ok, other})
[08:43:21] josevalim: \def foo({:ok, _} = tuple)
[08:43:25] josevalim: those are all valid
[08:44:33] Rich_Morin: josevalim: Yep, the problem I had was that I was trying to use "a = 1" rather than "1 = a".
[08:45:54] josevalim: the order doesn't matter inside a pattern
[08:46:04] josevalim: def foo({ok = :ok, other})
[08:46:09] josevalim: the above is also fine ^
[08:47:29] Rich_Morin: what about def foo(a = %{}) - would this ensure that this clause only bound to an empty Map and also bind a to it?
[08:50:14] Rich_Morin: sorry, that was incoherent. Would this ensure that this function clause only matched a call where the argument was an empty Map and also bind a to that map?
[08:50:43] dysfun: iirc %{} is the only map where it cannot contain extra keys
[08:51:11] dysfun: ie. %{} is only ever the empty map
[08:51:33] dysfun: but if you know it's the empty map, do you need to bind it to a?
[08:52:21] dysfun: (yes, pattern matching is oddly intricate and do-what-i-mean)
[08:52:34] Rich_Morin: in this case, I was binding an explanatory name to it, eg: def foo(_name = %{})
[08:52:45] dysfun: ah, then yes
[08:59:34] thoth: has joined #elixir-lang
[09:04:21] kyrylo: has joined #elixir-lang
[09:05:55] ariedler: has joined #elixir-lang
[09:28:19] gvaughn: has joined #elixir-lang
[09:38:15] Phylock: has joined #elixir-lang
[09:43:27] mdbm: has joined #elixir-lang
[09:44:41] ericmj: Rich_Morin: dysfun: maps in patterns do subset matching, so `%{}` in a pattern matches any map, empty or not
[09:49:34] thoth: has joined #elixir-lang
[09:51:28] wsieroci: has joined #elixir-lang
[10:02:51] iamvery: has joined #elixir-lang
[10:04:39] dysfun: maybe i'm thinking of erlang
[10:04:58] dysfun: or maybe i'm just misremembering entirely
[10:05:01] netrino: has joined #elixir-lang
[10:32:49] gvaughn: has joined #elixir-lang
[10:44:52] tnez: has joined #elixir-lang
[10:55:08] ariedler: has joined #elixir-lang
[11:03:33] josevalim: FWIW elixir and Erlang are the same
[11:06:05] wsieroci: has joined #elixir-lang
[11:08:19] iamvery: has joined #elixir-lang
[11:09:12] lizzin: has joined #elixir-lang
[11:23:12] dysfun: good to know
[11:23:19] dysfun: not sure where i got it from then. maybe core.logic
[11:30:31] craigp_: has joined #elixir-lang
[11:38:02] Cthalupa: has joined #elixir-lang
[11:40:49] gvaughn: has joined #elixir-lang
[11:55:46] dkrm: has left #elixir-lang: ("WeeChat 2.4")
[11:58:19] Gazler: has joined #elixir-lang
[12:01:54] toothfairy__: I'm trying to pass a graphql filter argument from frontend through resolver in phoenix to the model, however I must be doing something fundamental error... Limit argument works but not the filter/swish argument, no errors but also no results ... Any ideas? https://dpaste.de/SSzg#L16,17
[12:07:21] Gazler: toothfairy__: Can you inspect the query before Repo.all, it might give you some insight.
[12:11:40] InfinityFye: has joined #elixir-lang
[12:16:31] kapil____: https://gist.github.com/kapilpipaliya/c4725e918dcdc5719a3d9876cc919d12
[12:28:25] mdbm: has joined #elixir-lang
[12:38:21] pankracy: has joined #elixir-lang
[12:47:27] inoas: has joined #elixir-lang
[12:50:13] gvaughn: has joined #elixir-lang
[12:54:48] kyrylo_: has joined #elixir-lang
[13:02:04] BitBot: has joined #elixir-lang
[13:05:58] DarkSeid: has joined #elixir-lang
[13:09:43] lizzin: has joined #elixir-lang
[13:21:49] tnez: has joined #elixir-lang
[13:30:59] lpil: Hi everyone! How do I create HTML inputs for an embedded schema in Phoenix? I got from the docs that it would generate an ID for me but I'm getting Ecto.NoPrimaryKeyValueError when I submit my edit form
[13:33:52] toothfairy__: gazler: how do I inspect the query before Repo.all? I tried IO.inspect(filter) so far, not sure how to do what you suggest
[13:55:53] davidw: has joined #elixir-lang
[13:57:38] gvaughn: has joined #elixir-lang
[14:00:48] Cthalupa: has joined #elixir-lang
[14:03:57] jmiven: has joined #elixir-lang
[14:12:31] za1b1tsu: has joined #elixir-lang
[14:14:18] dimitarvp: has joined #elixir-lang
[14:15:22] lizzin: has joined #elixir-lang
[14:24:00] Rich_Morin: has joined #elixir-lang
[14:29:06] drewolson: has joined #elixir-lang
[14:31:12] voltone: has joined #elixir-lang
[14:38:43] Gazler: has joined #elixir-lang
[14:42:44] uranoss: has joined #elixir-lang
[14:48:56] lauromoura: has joined #elixir-lang
[15:07:44] wsieroci: has joined #elixir-lang
[15:09:27] shritesh: has joined #elixir-lang
[15:13:03] gvaughn: has joined #elixir-lang
[15:15:24] voltone: has joined #elixir-lang
[15:19:16] gvaughn: has joined #elixir-lang
[15:27:06] k1nd0f: has joined #elixir-lang
[15:31:52] salasrod: has joined #elixir-lang
[15:33:06] mahmudov: has joined #elixir-lang
[15:51:47] salasrod: has joined #elixir-lang
[16:04:07] voltone: has joined #elixir-lang
[16:20:17] kapil____: has joined #elixir-lang
[16:29:51] toothfairy__: I'm trying to pass a graphql filter argument from frontend through resolver in phoenix to the model, however I must be doing something fundamental error... Limit argument works but not the filter/swish argument, no errors but also no results ... Any ideas? https://dpaste.de/SSzg#L16,17
[16:40:03] Rich_Morin: has joined #elixir-lang
[16:40:29] Rich_Morin_: has joined #elixir-lang
[16:43:20] praveenperera: has joined #elixir-lang
[17:08:16] shritesh: has joined #elixir-lang
[17:12:25] orbyt_: has joined #elixir-lang
[17:13:15] Rich_Morin: has joined #elixir-lang
[17:24:45] praveenperera: has joined #elixir-lang
[17:29:58] nickjj: has joined #elixir-lang
[17:45:31] serafeim: has joined #elixir-lang
[18:00:48] Rich_Morin: has joined #elixir-lang
[18:00:56] kyrylo: has joined #elixir-lang
[18:03:36] shiro[cloud]: has joined #elixir-lang
[18:12:02] praveenperera: has joined #elixir-lang
[18:21:55] squall: has joined #elixir-lang
[18:25:03] tnez: has joined #elixir-lang
[18:34:02] PragTob: has joined #elixir-lang
[18:46:08] Gazler: has joined #elixir-lang
[18:59:43] inoas: has joined #elixir-lang
[18:59:56] praveenperera: has joined #elixir-lang
[19:05:04] cryptomata: has joined #elixir-lang
[19:07:10] Lyubo1: has joined #elixir-lang
[19:50:32] netrino: has joined #elixir-lang
[20:09:32] simerax: has joined #elixir-lang
[20:22:55] duane: has joined #elixir-lang
[20:30:43] inoas: has joined #elixir-lang
[21:10:36] griffinbyatt: has joined #elixir-lang
[21:15:36] ur5us: has joined #elixir-lang
[21:31:26] orbyt_: has joined #elixir-lang
[22:33:55] __charly__: has joined #elixir-lang
[22:55:39] orbyt_: has joined #elixir-lang
[23:30:21] Sgeo: has joined #elixir-lang
[23:32:15] Sgeo: has joined #elixir-lang
[23:33:07] __charly__: has joined #elixir-lang
[23:42:59] Rich_Morin: has joined #elixir-lang
[23:44:30] benwilson512: toothfairy__: your where clause isn't valid ecto
[23:45:13] benwilson512: suppose filter has the value "hello"
[23:45:26] benwilson512: your sql query would then be WHERE 'hello' = true which is always false
[23:45:32] benwilson512: since a string is never equal to a boolean
[23:45:52] benwilson512: so I guess my first comment was wrong. It's valid ecto, but it's always false
[23:46:17] benwilson512: what column are you trying to filter by?
[23:53:52] blahdodo: has joined #elixir-lang