by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 10:46
    adamransom commented #403
  • 10:17
    solnic commented #403
  • 10:03
    adamransom commented #403
  • 09:42
    adamransom commented #403
  • 09:39
    solnic commented #403
  • 09:36
    adamransom commented #403
  • 09:35
    adamransom commented #403
  • 09:33
    solnic commented #403
  • 09:29
    adamransom edited #403
  • 09:27
    adamransom opened #403
  • Jul 31 07:02
    flash-gordon commented #130
  • Jul 31 04:56

    solnic on master

    Merge pull request #131 from da… (compare)

  • Jul 31 04:55

    solnic on release-1.3

    small grammar changes to improv… Merge pull request #131 from da… (compare)

  • Jul 31 04:55
    solnic closed #131
  • Jul 31 04:53

    solnic on release-0.8

    Merge pull request #30 from dav… (compare)

  • Jul 31 04:51

    solnic on master

    Added in missing word and missi… Merge pull request #30 from dav… (compare)

  • Jul 31 04:51
    solnic closed #30
  • Jul 31 04:51
    solnic edited #30
  • Jul 31 00:21
    davich opened #131
  • Jul 31 00:18
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 ^^ :)
@AMHOL ^^
lemme know if you have some dsl ideas for that
we definitely need a way to explicitly name a group, which will be needed for messages, although this could default to concatenation of rule names within a group
eventually this will be nestable too, ie a group depending on another group etc
it should also be possible to create a group from rules that are applied to values from different levels of nesting
Piotr Solnica
@solnic
if you think that’s crazy, I can assure you this kind of requirements exist :joy: I’ve got a ton of this stuff in my current client project
Andy Holland
@AMHOL
@solnic I don't get what group is doing differently? Is it that it's calling an existing predicate with the values from two keys?
Group seems a bit of a strange name for that
Hannes Nevalainen
@kwando
I not sure about the name, but the functionality :thumbsup:
Piotr Solnica
@solnic
@AMHOL it groups rules so...
I mean I’m open to other names of course