Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Dec 04 18:40
  • Dec 03 17:32
    reedlaw starred dry-rb/dry-types
  • Dec 03 11:31
    timriley synchronize #155
  • Dec 03 11:31

    timriley on rich-component-dirs-config

    Clarify names Fixup naming Total messy WIP (compare)

  • Dec 02 22:38
    diegocasmo starred dry-rb/dry-initializer
  • Dec 02 17:58

    flash-gordon on wrapper-type

    Add wrapper type It's a POC of… (compare)

  • Dec 01 23:13
    hguerrerojaime synchronize #154
  • Dec 01 05:18
    timriley opened #155
  • Dec 01 05:10

    timriley on rich-component-dirs-config

    Fix wording of spec Add Rubocop rule Start getting component_dirs in… and 3 more (compare)

  • Nov 29 13:21
    flash-gordon commented #130
  • Nov 29 13:19
    flash-gordon commented #130
  • Nov 29 10:29
    bigsolom commented #87
  • Nov 29 07:42

    flash-gordon on master

    Add note about Do::All caveat … Merge pull request #134 from ma… (compare)

  • Nov 29 07:42
    flash-gordon closed #134
  • Nov 29 07:42
    flash-gordon commented #134
  • Nov 29 07:37
    flash-gordon closed #130
  • Nov 29 07:37
    flash-gordon commented #130
  • Nov 28 22:36

    dry-bot on master

    [devtools] sync (compare)

  • Nov 28 22:35

    flash-gordon on keep-method-visibility

    (compare)

Fran Worley
@fran-worley
Plus I use Reform which defines its own schema class...
panigrah
@panigrah
@fran-worley i am using this with reform, which just passes the block over to dry-v - would i need to monkey patch it to override the base schema class?
Tim Riley
@timriley
@fran-worley yep, looking over the code, I think it would be no problem to have a base schema class with a configure do; config.messages = “…”; end and then other schemas inheriting from that base and providing their own configure blocks too.
Fran Worley
@fran-worley
@timriley good to know
@panigrah not sure about Reform 2.2 but on 2.1 you would. It's one of my dislikes.
Andy Holland
@AMHOL
@panigrah @fran-worley it's just using dry-configurable so global configuration would be:
Dry::Validation::Schema.configure do |config|
  config.messages_file = '/path/to/my/errors.yml'
end
dan-klasson
@dan-klasson
@AMHOL yeah, that looks perfect. @panigrah stick that in config/initializers/trailblazer.rb
Fran Worley
@fran-worley
@AMHOL that is really useful. That should definitely go in the docs.
Andy Holland
@AMHOL
:+1:
Simon Schmid
@sled
Andy Holland
@AMHOL
@sled that's for configuring a single schema
Simon Schmid
@sled
ah you can configure it globally
:D
that's cool for an initializer
panigrah
@panigrah

I have a custom validation "unique?" for a rule called "name" - my error.yaml file is below

en:
  errors:
     unique?: "Value must be unique"

I continue to get

`Dry::Validation::MissingMessageError: message for unique?`
the error file is setup per AMHOL's posting above
Piotr Solnica
@solnic
What if you put it under name key?
Andy Holland
@AMHOL
@panigrah I take it you restarted/reloaded after adding the initializer ?
Fran Worley
@fran-worley
This message was deleted
Fran Worley
@fran-worley

@panigrah if you're writing an error for a rule you need your messages to look something like this:

en:
  errors:
    #regular error messages

  rules:
    name:
      unique?: "the name name must be unique"

Look at the end of the example on http://dry-rb.org/gems/dry-validation/error-messages/

panigrah
@panigrah
@fran-worley and @solnic - no luck. Will try to debug in the morning - am using master
Piotr Solnica
@solnic
We've got specs which covers this type of usecases but not for i18n. Maybe sth there is happening. I'll investigate when I'm back home from holidays (tomorrow)
dan-klasson
@dan-klasson
@solnic ha. i knew you couldn't stay away ;)
Pablo Herrero
@pabloh
Hey anyone got any thoughts regarding: dry-rb/dry-constructor#5 ?
Piotr Solnica
@solnic
@dan-klasson i did until yesterday
dan-klasson
@dan-klasson
@solnic yeah that's a lot better than i anticipated :)
how was the vacation? all nice any sunny beaches?
Piotr Solnica
@solnic
Got sun burned. So yes. Sunny
Simon Schmid
@sled
they should build UV light into computer screens to prepare for holidays ;)
Piotr Solnica
@solnic
Who would have thought that sun at 3000 meters mountain can harm you when you don't use any sunblocker
Simon Schmid
@sled
never been skiing? :)
Piotr Solnica
@solnic
I've been skiing since I was 3yo. I'm just a moron every now and then and forget about basic stuff :)
dan-klasson
@dan-klasson
oh man growing up in Sweeeden. My class mates in public school could not believe that I actually went skiing in Austria given how brown my skin was. Not knowing anything about Austria, they thought it was more plausible that I was lying. Hilarious. Man I'm still pissed at my dad for letting me grow up with those rednecks.
Christopher Dennl-Ortega Arrieta
@cdennl
@panigrah if you're using rails and i18n, don't specify the path but use config.message = :i18n
this is my custom file:
```
en:
  errors:
    is_conversion_correct?:                 'is incorrectly converted from P to $'
dan-klasson
@dan-klasson
@jodosha just made a comment
Luca Guidi
@jodosha
@dan-klasson ty!
Joe Van Dyk
@joevandyk
So what's the latest on using dry-v and types in rails?
Andrew Kozin
@nepalez
@solnic @AMHOL @timriley @marshall-lee & all: what do you think about this one: https://github.com/nepalez/dry-memoizer
(I keep extracting useful things from our current project)
Piotr Solnica
@solnic
@nepalez do you know memoizable?
Andrew Kozin
@nepalez
@solnic thanks! Yes, I do know it, but I dislike the DSL. As for me, let syntax is simpler and more readable in long computations.
tbh, I do not sure whether this let syntax sugar worth writing a special gem, I just try to extract it for a future.
Benjamin Klotz
@tak1n

is there an easy way in dry-v to access the value for which a predicate returns false in the error message?
or do I have to write a custom error compiler for that?

basically:

  def custom_predicate(value)
     false
  end

   en:
    errors:
     custom_predicate: "{value} whatever"
Piotr Solnica
@solnic
@tak1n IIRC we always pass value for interpolation, just try %{value} whatever
Benjamin Klotz
@tak1n
@solnic works thx, and for predicates which have 2 args? :D
left, right?
Piotr Solnica
@solnic
@tak1n left right is passed for ranges IIRC
lemme see (I forgot)