Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Apr 07 15:30

    davydovanton on rack-middleware-compat-with-rack-builder

    (compare)

  • Apr 07 15:30

    davydovanton on master

    Ensure `Dry::Monitor::Rack::Mid… Merge pull request #37 from dry… (compare)

  • Apr 07 15:30
    davydovanton closed #37
  • Apr 07 14:58
    JPalka starred dry-rb/dry-monads
  • Apr 07 14:49
    dry-bot commented #37
  • Apr 07 14:42
    jodosha edited #37
  • Apr 07 14:42
    jodosha review_requested #37
  • Apr 07 14:42
    jodosha labeled #37
  • Apr 07 14:42
    jodosha review_requested #37
  • Apr 07 14:42
    jodosha assigned #37
  • Apr 07 14:42
    jodosha opened #37
  • Apr 07 14:37

    jodosha on rack-middleware-compat-with-rack-builder

    Ensure `Dry::Monitor::Rack::Mid… (compare)

  • Apr 07 11:56
    davydovanton synchronize #145
  • Apr 07 11:56

    davydovanton on add-settings-section

    Update docsite/source/settings.… (compare)

  • Apr 07 11:43
    davydovanton commented #145
  • Apr 07 11:42
    davydovanton synchronize #145
  • Apr 07 11:42

    davydovanton on add-settings-section

    Fix lang-related suggestions (compare)

  • Apr 07 10:46
    davydovanton synchronize #145
  • Apr 07 10:46

    davydovanton on add-settings-section

    Update docsite/source/settings.… (compare)

  • Apr 07 10:46
    davydovanton synchronize #145
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)
nah, we don’t pass in args by default. could be changed. please report an issue
@tak1n ^
Benjamin Klotz
@tak1n
@solnic okay will do
panigrah
@panigrah
@cdennl after you set messages to i18n, where is your custom file?
Christopher Dennl-Ortega Arrieta
@cdennl
@panigrah config/locales/en/custom_dry_v_errors.yml
panigrah
@panigrah
how does dry-v pickup the errors.yml file?
Christopher Dennl-Ortega Arrieta
@cdennl
it doesnt, i18n does
and dry-v relies on i18n in this case
panigrah
@panigrah
so the name of the file can be anything?
Christopher Dennl-Ortega Arrieta
@cdennl
yes
you just have to set config.messages = :i18n to tell dry-v to rely on i18n
and assure that i18n is required before dry stuff
part of my initializer:
```
require 'i18n'
require 'cell/translation'
require 'reform/form/dry'
require 'disposable/twin/coercion'
panigrah
@panigrah
ok. And all messages are directly under errors with the rule name?
errors:
    rule_name1?: "Rule has a problem" 
    rule_name2?: "Another rule problem" 
Christopher Dennl-Ortega Arrieta
@cdennl
well common rules i put directly below errors if they are used in multiple contexts
otherwise i put them under a namespace below rules
en:
  errors:
    in_possession?:                         'is not in possession of deviation'
    is_conversion_correct?:                 'is incorrectly converted from P to $'
    not_blank?:                             'is blank'

    rules:
      auction:
        autobuy_amount_is_above_start_bid?: 'must be greater than start bid'
        currency_accepted?:                 'select at least one currency'
        is_conversion_correct?:             'is incorrectly converted from P to $'
      bid:
        is_no_self_bid?:                    'must not bid on own auction'
        is_running?:                        'is not running'
and then i set config.namespace = :whatever in the repsective validation group
panigrah
@panigrah
aah okay.