#elixir-lang

/

      • turtil joined the channel
      • chrisconstantin has quit
      • hassox has quit
      • mjs2600 joined the channel
      • hassox joined the channel
      • mjs2600
        @chrismccord I think you need to bump the phoenix version in phoenix_live_reload.
      • discypher has quit
      • hahuang65
        ericmj: is %Ecto.Changeset{model: model} already applied, or is it pre-changes?
      • zzing
        What are the best elixir editor/editor plugins? I have found every one of them is annoying in one way or another.
      • (that I have found)
      • ericmj
        hahuang65: it depends on where you are
      • hahuang65
        ericmj: validate_change
      • ericmj
        hahuang65: it's applied on Repo.insert/update
      • so not applied in validations
      • sajmoon has quit
      • hahuang65
        ericmj: shooties.
      • ericmj
        hahuang65: do you need the model?
      • hahuang65
        ericmj: that makes things... icky.
      • mrmargolis has quit
      • mrmargol_ joined the channel
      • ericmj: yeah trying to implement scope for validate_unique
      • ericmj
        why do you need the model for that?
      • hahuang65
        ericmj: at first, I thought, hey, let's just pass a query to the :scope in opts, but since I cannot merge 2 queries... it makes things sticky, without messing your beautiful code up :p
      • ericmj: so I thought, I'd have scope in opts be a list of atoms that represent fields on the model
      • ericmj: which means I'd have to fetch those attributes in validate_unique to query against it.
      • tristan__
        chrismccord: are you goingi to use a multibuildpack or what? since you need node for build?
      • hassox has quit
      • hassox joined the channel
      • hahuang65
        ericmj: for example: validate_unique(:title, scope: [:author_id])
      • ericmj
        tristan__: oh crap :(
      • tristan__
        or is node availably by default on a dyno an dI'm stupid and don't even kno whow Heroku works
      • ericmj
        tristan__: we need node
      • now im sad
      • hahuang65: use get_change=
      • hahuang65
        ericmj: does that return the original value if it wasn't chagned?
      • tristan__
        ericmj: it might be available without doing anything, I'm not sure
      • ericmj
        hahuang65: hold on, why do you even need the value?
      • the field is enough
      • ismaelga has quit
      • dberkom
        zzing: what editor do you prefer to use?
      • ericmj
        tristan__: i doubt it, since heroku updates the dynos once every 4 years :P
      • tristan__
        hah
      • ericmj
        hahuang65: you can also use a query but only the :where part
      • mmullis joined the channel
      • zzing
        dberkom, I have liked sublime, and have used brackets and atom recently. None of them are especially good, mainly what I want is no bullshit - correct syntax highlighting at the very least.
      • hahuang65
        ericmj: lemme gist this. I'm doing a horrible job explaing :)
      • emocakes joined the channel
      • ericmj
        hahuang65: do you need the change or the value before the change
      • because first you said you wanted the model after changes and then you said you didnt want to use get_change :P
      • cpjk joined the channel
      • losvedir has quit
      • tristan__
        ericmj: chrismccord yea I guess you'll want ot make a phoenix buildpack
      • mjs2600 has quit
      • myronmarston has quit
      • schainks joined the channel
      • notduncansmith joined the channel
      • myronmarston joined the channel
      • myronmarston has quit
      • xissburg has quit
      • dberkom
        zzing: I'm a former Sublime user, now I mostly use Vim. The package I use has good syntax highlighting: https://github.com/elixir-lang/vim-elixir
      • mmrobins has quit
      • zzing
        hmm vim
      • dberkom
        zzing: but switching to vim might be a little extreme
      • zzing
        that is true
      • ducduong joined the channel
      • schainks_ joined the channel
      • mjs2600 joined the channel
      • imsys joined the channel
      • ptrckbrwn joined the channel
      • schainks joined the channel
      • ducduong has quit
      • devinus joined the channel
      • ptrckbrwn has quit
      • icecreamcohen has quit
      • icecreamcohen joined the channel
      • imsys has quit
      • havenwood has quit
      • hahuang65
        ericmj: sorry about that, I got distracted
      • zzing
      • hahuang65
        ericmj: I'd need the change if it's been changed, otherwise I'd need the original value
      • MachinesAreUs has quit
      • ericmj
        hahuang65: get_change(changeset, :field, changeset.model.field)
      • hahuang65
        ericmj: I might have screwed up that reduce in the second idea, but basically the idea is to reduce all the atoms in scope and merge all those queries in.
      • notduncansmith joined the channel
      • ericmj
        hahuang65: i think the plan was to use a query though?
      • hahuang65
        ericmj: ah the /3
      • ericmj: yeah i'd like to, which was the first idea
      • ericmj: but I got stuck, if I pass in a query, how do I merge it with the quer that's already there?
      • losvedir joined the channel
      • ericmj: I suppose I could kill line 10, and only define that if opts[:scope] isn't there.
      • joshwlewis joined the channel
      • cpjk has quit
      • ericmj
        hahuang65: don't select the field, just select true
      • no need to send the field to the application
      • cpjk joined the channel
      • yeah, the query is not going to work
      • we should talk to josevalim tomorrow
      • a list of fields is probably the right way to go
      • and you can use get_change for that
      • hahuang65
        ericmj: yeah, cool, thanks for the tips.
      • schainks_ joined the channel
      • ericmj: I'm not selecting the field :) that was there when I pulled up this code today
      • ericmj
        ah
      • hahuang65
        ericmj: you're talkinga bout line 10 in my gist right?
      • laut has quit
      • falood joined the channel
      • cpjk has quit
      • ericmj: it has issues, where we need to make sure that they've passed in a query that's querying the right model though...
      • falood has quit
      • mattmcclure joined the channel
      • ericmj
        hahuang65: it's weird because the :scope needs to have the same source as the model
      • if it has a different source it will be completely wrong
      • hahuang65
        ericmj: I agree :)
      • yes
      • we can check
      • I suppose :p
      • ericmj
        we can check, but still weird
      • hahuang65
        but I think list of fields is cleaner... they shouldn't have a unique scope that differs from what's on that object already anyways
      • i'll try to catch you and jose online together sometime tomorrow
      • Gabiz has quit
      • ericmj: gotta run, thanks for the input :)
      • ericmj: I'll summarize what we talked about just now and stick it in the issue as well
      • true_droid joined the channel
      • AhabsBeard joined the channel
      • hahuang65 has quit
      • true_droid has quit
      • notduncansmith joined the channel
      • schainks joined the channel
      • joconnor has quit
      • mrmargol_ has quit
      • bkearns1 has quit
      • ismaelga joined the channel
      • schainks_ joined the channel
      • chrisconstantin joined the channel
      • jholland has quit
      • schainks joined the channel
      • gabiz joined the channel
      • codestorm joined the channel
      • zzing
        What is the difference between ["html"] (from a generated phoenix router), and ~w(html) (from the documentation on 0.12 routing)
      • notduncansmith joined the channel
      • notduncansmith has quit
      • ericmj
        zzing: nothing
      • amclain joined the channel
      • codestorm has quit
      • schainks_ joined the channel
      • falood joined the channel
      • zzing
        ok
      • falood has quit