by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 07 14:18
  • Aug 06 20:26
    psilospore starred dry-rb/dry-monads
  • Aug 06 08:32
    solnic commented #32
  • Aug 06 08:30
    solnic milestoned #32
  • Aug 06 03:05
    razertory starred dry-rb/dry-monads
  • Aug 06 01:46
  • Aug 05 14:01
    francois commented #32
  • Aug 04 12:29
    flash-gordon commented #403
  • Aug 04 10:46
    adamransom commented #403
  • Aug 04 10:17
    solnic commented #403
  • Aug 04 10:03
    adamransom commented #403
  • Aug 04 09:42
    adamransom commented #403
  • Aug 04 09:39
    solnic commented #403
  • Aug 04 09:36
    adamransom commented #403
  • Aug 04 09:35
    adamransom commented #403
  • Aug 04 09:33
    solnic commented #403
  • Aug 04 09:29
    adamransom edited #403
  • Aug 04 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)

Christopher Dennl-Ortega Arrieta
@cdennl
configure do
        config.messages   = :i18n
        config.namespace  = :bid
        config.predicates = Dagavel::Predicates

        option :form

        def is_no_self_bid?( user )
          user.id != form.auction.user_id
        end

        def is_running?( auction )
          auction.is_running?
        end
      end
panigrah
@panigrah

this is the yml file

en:
   hello: "Hello world"
   errors:
      unique? : "WTF"

and initializer has required i18n on top before dry-v and reform and configure block has the same

i have 0.7.4 dry-v. I will take a break for now
thanks for your help!
Christopher Dennl-Ortega Arrieta
@cdennl
np
panigrah
@panigrah
@cdennl i just realized - that the global setting that was suggested by AMHOL doesn't work in my case. But if I put config.messages_file into my validation block then it works.
Christopher Dennl-Ortega Arrieta
@cdennl
messages_file or messages?
panigrah
@panigrah
messages_file and messages shows me a different error - perhaps i have a problem with i18 setup
Piotr Solnica
@solnic
You need to make sure i18n loads all your locale files
Christopher Dennl-Ortega Arrieta
@cdennl
my initializer for i18n:
```
# tell the I18n library where to find your translations
I18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')]

# set default locale to something other than :en
I18n.default_locale = :en
Pablo Herrero
@pabloh
Sry if this was already asked, why dry-types depends on concurrent-ruby?
Hunter Madison
@hmadison
Thread safety stuff iirc
Piotr Solnica
@solnic
@pabloh we use concurrent::cache
Don Morrison
@elskwid
is this the @solnic hugs chat?
Cause I have one I’d like to give him.
:heart:
Piotr Solnica
@solnic
Heh. It's a dry-rb chat. But we can hug each other nevertheless ;)
Don Morrison
@elskwid
I’ve been lurking around as I do and thought you could use some happy thoughts.
panigrah
@panigrah
@cdennl couldn't get i18n to load. I have to get i18n eventually - but for now - this worked in an initializer. I am using reform 2-2 branch which is setup to use the new dry-v api. @fran-worley if you aren't having luck with the global setup for error messages - this may help.
Dry::Validation::Schema::Form.configure do |config|
  config.messages = :yaml
  config.messages_file =  "#{Rails.root}/config/locales/en/dry-v-custom-messages.yml"
end
Piotr Solnica
@solnic
@panigrah please report an issue. A simple reproduction script would be very helpful too
dan-klasson
@dan-klasson
@panigrah post the repo and updated branch here to reproduce the error
Tim Riley
@timriley
Here’s a draft of my next next-gen Ruby article: “Functional command objects in Ruby”. Would appreciate any feedback! https://draftin.com/documents/854843?token=Qm-VkDc3aIYo_FAKreRlkmY_iiCcSIBjf4tn2J2A40eQR28Z0VWG7uHDGsN3LxY_KXmw4tbcm95DEMveJqCcEfE
Andy Holland
@AMHOL
@timriley nice job, really nice article :+1:
Benjamin Klotz
@tak1n
@timriley awesome article :+1: :D
Kuba Krzempek
@kubakrzempek
@timriley I like it too :thumbsup: Learnt quite a few from it.
Tim Riley
@timriley
Thanks! After some other feedback I just updated the rspec example to make it better at simluating a real validation object. And added an explainer about why I’m just hand-waving the persistence step away.
Piotr Solnica
@solnic
@timriley :+1:
Tim Riley
@timriley
Woot, the solnic thumbs-up!
timriley @timriley sneaks back into the draft and names this The Solnica Pattern ;)
Tim Riley
@timriley
Actually though, I might add a note that this approach needn’t be restricted to commands only. Works for anything which would otherwise make sense as a standalone function, and not some part of an object with a wider API.
Nikita Shilnikov
@flash-gordon
@timriley great! That's how I write code today thanks to dry-stuff :)
Also most of my my classes returns Either object so I can compose it with dry-transaction
Tim Riley
@timriley
@flash-gordon awesome :) Yeah, in this article I’m side-stepping Eithers for simplicity. I hope to introduce them in 3 or 4 more weeks :grin:
Nikita Shilnikov
@flash-gordon
Yeah, don't push too hard lol
Andy Holland
@AMHOL
I'd consider not adding the side note about the same interface being applicable to other situations for the sake of simplicity too
Tim Riley
@timriley
@AMHOL True. I’ll just make that another article. Heh.
Andy Holland
@AMHOL
:D
Any plans to link to these articles from the dry-rb.org site too?
Would be cool to have an "External resources" page
Tim Riley
@timriley
Good question. Would be pretty easy to throw up a resources page for links elsewhere. I’d be happy to help with that. Alternatively, if you think these articles express the dry-rb philosophy well enough – and if we have an editorial policy that allows more than strict orginsation “news” – I’d even be happy for the articles to be cross-posted through to the dry-rb.org blog
Andrew Kozin
@nepalez
@timriley nice! cannot wait the next one
Andy Holland
@AMHOL
@timriley cross-posting would be cool, could just add an attribution link at the top
Also SEO implications to consider, duplicate content and all
Tim Riley
@timriley
I don’t spend much time thinking about SEO. Is duplicate content bad? Given it’s only in a few places (Icelab’s blog, cross-posted to Medium, and now dry-rb.org)...
Andy Holland
@AMHOL
Is it posted directly to Medium or as an external link?
Tim Riley
@timriley
I make a full copy of the article there. Just giving it a try to see if I can reach more people.
With an “originally posted on…” link at the bottom
Andy Holland
@AMHOL
I notice some are hosted on their site and some are just external links, would be better if you could just use the external link method, also drives traffic to your site :)