Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Dec 12 21:34
    flash-gordon commented #376
  • Dec 12 21:34
    flash-gordon labeled #376
  • Dec 12 21:34
    flash-gordon opened #376
  • Dec 12 19:32
    RyanLafferty starred dry-rb/dry-types
  • Dec 12 05:53
    technofreak starred dry-rb/dry-monads
  • Dec 12 00:14
    thekuwayama starred dry-rb/dry-monads
  • Dec 11 09:29
    blasterun starred dry-rb/dry-monads
  • Dec 11 08:34
    flash-gordon closed #115
  • Dec 11 08:34
    flash-gordon commented #115
  • Dec 11 08:31

    flash-gordon on v1.3.3

    (compare)

  • Dec 11 08:30

    flash-gordon on master

    Bump version to 1.3.3 (compare)

  • Dec 11 08:30

    flash-gordon on master

    Update CHANGELOG (compare)

  • Dec 10 23:46
    johnmaxwell commented #116
  • Dec 10 21:54

    flash-gordon on master

    Halt with mutable backtrace Ex… Merge pull request #116 from jo… (compare)

  • Dec 10 21:54
    flash-gordon closed #116
  • Dec 10 21:54
    flash-gordon commented #116
  • Dec 10 21:49
    johnmaxwell commented #116
  • Dec 10 21:47
    johnmaxwell commented #116
  • Dec 10 21:43
    johnmaxwell commented #116
  • Dec 10 21:39
    johnmaxwell commented #116
Tim Riley
@timriley
no :(
Adam Davies
@adz

required(:email).filled(scoped_unique?: :email, scope?: { active: true })

should be

required(:email).filled(scoped_unique?: [:email, { active: true }])

Tim Riley
@timriley
yeah
Adam Davies
@adz
its hard when you don’t know how the DSL is structured… i’m kind of inferring from examples
getting clearer
Ok — @timriley i updated my PR to the docs to correct
dry-rb/dry-rb.org#138 let me know if that is correct now?
Adam Davies
@adz

One more thing — is it possible to infer the key of the predicate being tested?

that “required(:email).filled(unique?: :email)” has to repeat the ‘email’ key as an arg

Tim Riley
@timriley
@adz AFAIK the predicates don’t know which key they’re being used on, no
I thought there might’ve been a GH issue about this, but I can’t find it.
Adam Davies
@adz
ok
Adam Davies
@adz
Anyone use dry pipeline? Seems like dry transaction supersedes it with similar functionality
Tim Riley
@timriley
Yeah, dry-pipeline never really went anywhere
rom has something like it built internally for function composition but it’s not separate
Adam Davies
@adz
I feel the urge to chain functions and seems to fit
Tim Riley
@timriley
yeah, I use dry-monads and return monads to do that
maybe the pipeline thing is useful in other kinds of cases
Adam Davies
@adz
Doing elm has corrupted me such that I'm uncomfortable with mutations :0
Tim Riley
@timriley
:)
Adam Davies
@adz
This message was deleted
This message was deleted
First time doing rails for
A year or so
... Dry stuff feels very nice :smiley:
Tim Riley
@timriley
Good to hear! Still a way to go, but we’re getting there :)
Rafael
@lastk
how do I require a field only if the value of another field is equals to X ?
Vasilis Spilka
@vasspilka

hey there, a ruby question, how do we change namespace scope..
I remember you did something like

something < self
end

then you could define without saying def self.method

Rafael
@lastk
class < self
Vasilis Spilka
@vasspilka
oww yes, can I also use it to change the namespace in general
for example in order to avoid using Module::Class somewhere
becouse now that I think of it thats not what I wanted...
Rafael
@lastk
Im not sure what you want to do
Vasilis Spilka
@vasspilka
ok, let me get into more detail
I have the following
module Ranking
  class Ranking

    # bla bla bla stuff

    def get_score(user)
      Metrics::METRICS.reduce(0) do |points_total, (metric, points)|
        points_total + metric.calculate(user, @scope) * points
      end
    end
  end
end
module Ranking
  module Metrics
    METRICS = {
      Metrics::Messages       => 30,
      Metrics::Activity       => 40,
     ......
    }
  end
end
what I want to avoid is having to say Metrics::Xxxxxx in the METRICS constant
Vasilis Spilka
@vasspilka
I know I could just add "Metrics::" and the eval, but... I don't know seems like there should be a way to avoid that meta
Rafael
@lastk
it shouldnt be just: METRICS == { Messages => 30 } ?
Vasilis Spilka
@vasspilka
Well it could, but then the Ranking class that is in a different naming scope would fail to find them
Hmmm... I guess I could restructure the order of the modules.. but.. owww I just want better namespace handling :'( :sob:
Vasilis Spilka
@vasspilka
seems I can do this metric = Object.const_get("Metrics").const_get(metric.to_s), hurts my eyes
Vasilis Spilka
@vasspilka
Hmmm... thats interesting... turns out I'm a whiny prick and it worked all along like you mention @lastk.
I must have been doing something different earlier or was just ignorant.. sry
Rafael
@lastk
haaha, np :)
Andy Holland
@AMHOL
@vasspilka pretty sure you can write that like: Metrics.const_get(metric)
Ralf Schmitz Bongiolo
@mrbongiolo
On dry-validation, when using rules inside an array why they don't return the item index like other errors?
Ex: {:should_have_investment_rate_only=>["must be filled", "must be filled", "must be filled", "cannot be defined"], 2=>{:minimum_investment=>["is missing"]}}
The rule :should_have_investment_rate_only return an array of error messages, but it's not possible to know if it was on item 1,2 or 42..
Tim Riley
@timriley
@mrbongiolo that sounds like a bug to me. Worth filing a GH issue?
Ralf Schmitz Bongiolo
@mrbongiolo
I'll do it @timriley
Tim Riley
@timriley
Thanks!
Abinoam P. Marques Jr.
@abinoam
Hi @vasspilka . Im a little late at the conversation and im lacking context. Where is Metrics::Messages being defined? It seems it's just being resolve inside the METRICS hash definition.
Maciej Mensfeld
@mensfeld
hello
+egl?+ is not a valid predicate name