by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 11 19:59
    esparta commented #132
  • Aug 11 16:30
    philipce closed #132
  • Aug 11 16:30
    philipce commented #132
  • Aug 11 07:47
    esparta commented #132
  • Aug 11 07:29
    esparta commented #132
  • Aug 11 07:28
    esparta commented #132
  • Aug 11 01:30
    philipce labeled #132
  • Aug 11 01:30
    philipce opened #132
  • Aug 10 18:51
    gbrlcustodio starred dry-rb/dry-monads
  • Aug 10 10:49

    solnic on master

    Fix redefinition warnings happe… Merge pull request #150 from es… (compare)

  • Aug 10 10:49
    solnic closed #150
  • Aug 10 07:58
    esparta edited #150
  • Aug 10 07:58
    esparta edited #150
  • Aug 10 07:51
    esparta opened #150
  • Aug 09 16:13
    charly starred dry-rb/dry-initializer
  • Aug 09 03:48
    slashpai starred dry-rb/dry-system
  • Aug 08 14:57
    bobwhitelock starred dry-rb/dry-types
  • Aug 07 14:18
  • Aug 06 20:26
    psilospore starred dry-rb/dry-monads
Andy Holland
@AMHOL
Yeah, I think it would be nice if you could use DI and have call return what you need in the context of your use-case
#messages seems like a specialisation, which introduces an un-necessary, context-specific API IMO
I.e. I could inject/configure Dry::Validation::Compilers::Hash.new or Dry::Validation::Compilers::I18n.new and have #call just return what I need
Piotr Solnica
@solnic
yes that’s cool
Andy Holland
@AMHOL
:+1:
Piotr Solnica
@solnic
gotta run, ttyl
Andy Holland
@AMHOL
:wave:
Benjamin Klotz
@tak1n
"wait, who needs DI, let’s monkey-patch Array instead" , finally a comment which I can take out of context and post on twitter that solnic supports active support, but then again everyone who knows him knows that he doesn't :joy: :joy:
Piotr Solnica
@solnic
@tak1n lol :)
Hannes Nevalainen
@kwando
@solnic how about "dynamic" values in validation? Like "time" needs to be in the future
key(:time}{ |t| t.time? & t.gt?(Time.now) } won't work, maybe something like key(:time){ |t| t.time? & t.gt?{ Time.now }}
Hannes Nevalainen
@kwando
Hmm, I can just use my own predicate ^^
Piotr Solnica
@solnic
yes either a custom one or maybe we could add future? predicate
Hannes Nevalainen
@kwando
yeah, there is probably some more useful predicates for working with date/time
Piotr Solnica
@solnic
definitely
t.year?(2000) etc
Hannes Nevalainen
@kwando
t.weekday? (though that one is locale specific)
How would the schema work when two keys is dependent on each other? a.int? & b.int? & a > b
Piotr Solnica
@solnic
not implemented, yet
you’ll have something like this, soon:
Hannes Nevalainen
@kwando
thought so =P
Piotr Solnica
@solnic
on(:a, :b) { |a, b| a.gt?(b) }
this means “when :a and :b are valid, also check this"
not entirely sure how the dsl will look though
Hannes Nevalainen
@kwando
ah ok, that would be very useful =)
Piotr Solnica
@solnic
I know, it’s high on my list
it’s one of the many personal pet peeves I’ve got with AM::V that I want to fix in dry-v
Hannes Nevalainen
@kwando
already love this => MyFormValidator.new.messages(params).params
Piotr Solnica
@solnic
hah yeah, coerced params are sweet
and safe, ootb
I’ll add structure validation too, soon
Hannes Nevalainen
@kwando
When you can use your own types and coercions this will be event sweeter =)
when/if
Piotr Solnica
@solnic
you can
no public API for that yet though, but it’s possible
it’s only a matter of registering your type within dry-data and defining your predicate
…and extending type compiler, but we can collapse those 3 steps into a single method call
and extending type compiler means adding your_predicate => your_type mapping :joy:
sounded so serious when I wrote it :D
Hannes Nevalainen
@kwando
oh? you're spoiling us <3
Piotr Solnica
@solnic
dry-data is extendible, so is dry-validation
Hannes Nevalainen
@kwando
I don't really like the globalness of Dry::Data right now
Piotr Solnica
@solnic
yeah, I will probably add a way of setting your own container
I also thought about having a way to define types under constants, so it feels more natural to define things like attribute :foo, MyTypes::Something::Foo
but I dunno, we’ll see
Hannes Nevalainen
@kwando
cool =)
feels like you have a plan for everything =P
Piotr Solnica
@solnic
I certainly don’t, but I’ve thought about a ton things, I gotta say :)
@kwando ^^ :)