Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Nov 18 00:58
    dteoh starred dry-rb/dry-types
  • Nov 17 21:02
    flash-gordon commented #374
  • Nov 17 21:01

    flash-gordon on master

    Update custom_ci.yml Merge pull request #374 from sk… (compare)

  • Nov 17 21:01
    flash-gordon closed #374
  • Nov 17 20:59
    skryukov opened #374
  • Nov 17 16:42

    flash-gordon on use-immutable-equalizer

    (compare)

  • Nov 17 16:42

    flash-gordon on master

    Use immutable equalizer for all… Merge pull request #373 from dr… (compare)

  • Nov 17 16:42
    flash-gordon closed #373
  • Nov 17 16:38
    flash-gordon opened #373
  • Nov 17 16:38

    flash-gordon on use-immutable-equalizer

    Use immutable equalizer for all… (compare)

  • Nov 17 16:34

    flash-gordon on no-rewrap-for-structs

    (compare)

  • Nov 17 16:34

    flash-gordon on master

    Don't build constructors when c… Merge pull request #371 from dr… (compare)

  • Nov 17 16:34
    flash-gordon closed #371
  • Nov 16 11:28
    marekciupak starred dry-rb/dry-monads
  • Nov 16 07:48
    luizfonseca starred dry-rb/dry-view
  • Nov 15 18:52
    waiting-for-dev commented #114
  • Nov 15 16:06
    businessBoris starred dry-rb/dry-system
  • Nov 15 15:16
    businessBoris starred dry-rb/dry-monads
  • Nov 15 08:22
    gruz0 starred dry-rb/dry-types
  • Nov 14 12:03
    pedrofurtado starred dry-rb/dry-matcher
Piotr Solnica
@solnic
which I actually copied from sequel-rails railite
but it won’t be like that for long
because I’ll be adding proper support for instrumentation to rom and rom-sql (as I mentioned already)
Oskar Szrajer
@gotar
Wot so fast ;] I need update again :)
@timriley I update dry view in the project and everything work ok (but will probably change few things after I see how you guys resolve it in berg, I'm not fully happy how I extend view_context by assets and current user . Plus I spend some time investigating why my partial do not work (single one) and found that it have the same name as one method in context. So it render method not partial, It's something a lot probably hit one day, so maybe another idea here will be better to explicity know when I want to render partial and when method
Oskar Szrajer
@gotar
@solnic I think your last update for dry-web-(roda) can cause problems - (need changes in dry-web-roda). It requires log directory to exists for any app in apps folder, store logs there not in main log directory, plus app generator for dry-web-roda already add to boot logger and register it as logger in Container so it crash . Maybe it's only my app but worth to check
Tim Riley
@timriley
Thanks for for trying these out, @gotar. I'll check dry-web-roda today
Oskar Szrajer
@gotar
chages required (I assume are required) for dry-monitor are super easy, both for app generator to drop custom logger and add two directories
Piotr Solnica
@solnic
@gotar yeah I didn’t have time to update generators
I’ll add docs over the weekend while flying to AU :laughing:
btw we follow “shifted semver” so if you see a minor bump while we’re still in beta (and all dry gems are in beta) then it means a breaking change
and re logger, just configure config.logger = YourMainContainer[:logger] in sub-apps
unless you want separate loggers per app
Darcy Laycock
@Sutto
@solnic when do you get in?
Piotr Solnica
@solnic
@Sutto Sunday morning
we’re going to London first, spending the night, then jumping on a plane on Saturday again
Darcy Laycock
@Sutto
awesome - all sorted for when you get here?
Piotr Solnica
@solnic
I hope so :laughing:
Darcy Laycock
@Sutto
The Rubyconf AU organisers are usually pretty fantastic at having all basses covered haha
Piotr Solnica
@solnic
oh yes they are amazing
Tim Riley
@timriley
@solnic FYI: I’m working on updating the dry-web-roda generators
Pat Collins
@patcoll
If I want to validate a list of email addresses at a particular key, what would be the syntax to do that?
Jonah
@jonahx
I’m trying to create a custom form validation. I got the validation part working but not sure how to customize the coercion part automatically. Here’s what I have so far:
schema = Dry::Validation.Form do
  configure do
    def future_date?(value)
      Date.new < Date.parse(value)
    end
  end
  required(:date).filled(:future_date?)
end
Piotr Solnica
@solnic
@jonahx filled(:date?, :future_date?)
Jonah
@jonahx
@solnic ah, so simple. ty sir!
@solnic but say i needed to coerce to some custom object, MyCustomObj. is this easily possible too?
Piotr Solnica
@solnic
@jonahx why?
Jonah
@jonahx
@solnic, i’m not sure i understand the question. why do you coerce into built-in ruby objects like Date or Integer?
Piotr Solnica
@solnic
why you want to coerce to a custom object :)
Jonah
@jonahx
i’ll make an example, since my current example the above works well :). but say user enters a hex value for a color into a form. i want to validate it’s a valid hex value and coerce into a custom Color object that has some nice methods for working with colors, say.
Piotr Solnica
@solnic
do you need a color object for something else than the validation?
Jonah
@jonahx
yeah the “domain” code that uses the params is what would use it. So no, the Color wouldn’t be used within the validation.
Piotr Solnica
@solnic
@jonahx you can do this for more control http://dry-rb.org/gems/dry-validation/input-preprocessing/
explicit type specs will be default API in 1.0.0 btw
Jonah
@jonahx
@solnic thx for link i will reread that part. one more quick question is there a quick way to define error messages without going through a custom yaml file? eg, in this case i only need to define a single error message for this one custom future_date? method and i’d prefer to define it in code near where future_date itself is defined
I guess we should document this
Jonah
@jonahx
@solnic cool, ty. i was just in the midst of using pry to try to figure that out :), you saved me some minutes. i’d even recommend a chrome method over that , but that might be a micro-optimization
Jonah
@jonahx
@solnic I’m getting an uninitialized constanct Messages error:
schema = Dry::Validation.Form do
  configure do
    def future_date?(value)
      Date.today < value
    end
    def self.messages
      Messages.default.merge(
        en: { errors: { future_date?: 'Date must be in the future' } }
      )
    end
  end
  required(:date).filled(:date?, :future_date?)
end
i thought it was because i was in Form instead of Schema but Schema isn’t working for me either...
Jonah
@jonahx
@solnic finally got it working. not sure if it’s the best way or why the way in your spec didn’t work for me, but the following works:
schema = Dry::Validation.Form do
  configure do
    def future_date?(value)
      Date.today < value
    end
    def self.messages
      default_messages.merge(
        en: { errors: { future_date?: 'Date must be in the future' } }
      )
    end
  end
  required(:date).filled(:date?, :future_date?)
end
Piotr Solnica
@solnic
@jonahx IIRC we have include Dry::Validation in spec_helper there heh
which is probably a stupid idea
Jonah
@jonahx
@solnic do i have the Piotr stamp of approval on what I did above? :)
Piotr Solnica
@solnic
@jonahx does it work? :D
Jonah
@jonahx
@solnic it does! i think it would be better to merge on messages rather than default_messages, but you get infinite recursion doing that...
Piotr Solnica
@solnic
it’s tricky stuff
defo a focus for 1.0.0
(to improve it)