Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Apr 09 12:23
    k0va1 starred dry-rb/dry-container
  • Apr 09 08:33

    dry-bot on master

    [devtools] sync (compare)

  • Apr 09 08:33

    solnic on master

    Update changelog.yml (compare)

  • Apr 09 08:21

    solnic on v0.3.2

    Bump dry-monitor to 0.3.2 (compare)

  • Apr 09 08:20
    flash-gordon commented #38
  • Apr 09 08:19

    dry-bot on master

    [devtools] sync (compare)

  • Apr 09 08:19

    solnic on master

    Update changelog.yml rubocop --safe-auto-correct Ignore warnings from rouge gem and 1 more (compare)

  • Apr 09 08:03
    mensfeld commented #38
  • Apr 09 02:41
    DaiAoki starred dry-rb/dry-monads
  • Apr 08 23:53

    davydovanton on improve-allocation-of-logger

    (compare)

  • Apr 08 23:53

    davydovanton on master

    Don't create a new formatter ob… Merge pull request #38 from dry… (compare)

  • Apr 08 23:53
    davydovanton closed #38
  • Apr 08 18:00
    dry-bot commented #38
  • Apr 08 17:59
    davydovanton review_requested #38
  • Apr 08 17:59
    davydovanton assigned #38
  • Apr 08 17:59
    davydovanton opened #38
  • Apr 08 17:54

    davydovanton on improve-allocation-of-logger

    Don't create a new formatter ob… (compare)

  • Apr 08 17:29
    JuPlutonic starred dry-rb/dry-monitor
  • Apr 08 13:48
  • Apr 08 09:13

    solnic on release-0.17

    Add information about built-in … (compare)

Piotr Solnica
@solnic
basically to have the same setup as we have in specs loaded for you so it’s easy to open console and do stuff
The last two are quite old
Damn, forgot that Gitter would expand those, sorry for the flood :(
Luca Guidi
@jodosha
@AMHOL Thank you! :green_heart:
Andy Holland
@AMHOL
:+1:
Piotr Solnica
@solnic
@jodosha do you have any ideas what kind of integration you’d want to have?
Luca Guidi
@jodosha
@solnic My goals are: remove boilerplate as much as possible, SQL automapping, associations and command/queries.
Andy Holland
@AMHOL
@jodosha you're in luck then, it's all supported already
Luca Guidi
@jodosha
@AMHOL ;)
Piotr Solnica
@solnic
@jodosha do you like to provide mixins in a similar way like with validations?
Luca Guidi
@jodosha
@AMHOL @solnic yes, for instance, I will probably make this https://gist.github.com/AMHOL/83796ede7e3e3219c6f6c934823dfd3e#file-rom-repo-starter-rb-L29-L45 to happen behind the scenes
Piotr Solnica
@solnic
yep, I think getting setup in place would be a good first step
Andy Holland
@AMHOL
@jodosha would that mean exposing a generalised querying API via relation? That kind of defeats the object of the relation being there
Piotr Solnica
@solnic
ie provide config API for hanami-model where you set connection options and then it would set up ROM behind the scenes
Andy Holland
@AMHOL
The relation should make use of the dataset API to expose a domain specific query interface
Piotr Solnica
@solnic
it should also auto-require relations and optional custom mappers and commands
Andy Holland
@AMHOL
:+1: That works
Luca Guidi
@jodosha
@solnic yes
Andy Holland
@AMHOL
@solnic could this just be a plugin for rom-sql?
Piotr Solnica
@solnic
nah, it’s all there already in rom core, it’s a matter of configuring it
Andy Holland
@AMHOL
Ahh OK
Luca Guidi
@jodosha
@solnic @AMHOL I'll probably ask questions on specific topics. ;)
Andy Holland
@AMHOL
Cool :)
Piotr Solnica
@solnic
@jodosha let’s chat in rom-rb room, I’m there
Luca Guidi
@jodosha
:+1:
Piotr Solnica
@solnic
Andrew Kozin
@nepalez
@timriley I've made last 3 commits (at various times) directly to master
Aditya Tiwari
@aditya01933
Hi, I have a small question.
How can I remove code duplication in following Schemas:
Ahh .. I don't know how to paste code block in gitter
Piotr Solnica
@solnic
@aditya01933 use triple `
like that:
\`\`\`
your code
\`\`\`
Aditya Tiwari
@aditya01933
require 'dry-validation'
UserSchema = Dry::Validation.Schema do

  key(:username).required(:unique?)
  key(:name).required
  key(:email).required
  key(:password).confirm
  configure do
      config.messages_file = 'config/validations/errors.yml'
      config.input_processor = :sanitizer
     def unique?(value)
         User.find_by(username: value).nil?  
     end
  end
end
UserUpdateSchema = Dry::Validation.Schema do

  optional(:username).required(:unique?)
  optional(:name).required
  configure do
   config.messages_file = 'config/validations/errors.yml'
   config.input_processor = :sanitizer
    def unique?(value)
       User.find_by(username: value).nil?
    end
  end
end
Piotr Solnica
@solnic
oh well
Aditya Tiwari
@aditya01933
@solnic its not perfect but better
Any solution please ???
I want to remove code duplication of configuration block and "unique" custom predicate
Piotr Solnica
@solnic
class MySchema < Dry::Validation::Schema
  configure do |config|
    config.messages = :i18n
  end

  def unique?(value)
    false
  end

  def self.define(&block)
    Dry::Validation.Schema(self, &block)
  end
end

UserSchema = MySchema.define do
  key(:email).required(:unique?)
  key(:name).required
end
@aditya01933 like that ^
Aditya Tiwari
@aditya01933
@sonic Perfect!!!!!
Thanks its exactly what i was looking for :)
Piotr Solnica
@solnic
cool :)
Aditya Tiwari
@aditya01933
@solnic one more small question..
Currently i m testing uniqueness of username like
 def unique?(value)
      User.find_by(username: value)
  end
How can i write unique? in such a way that it can test uniqueness of other keys like name, email etc too ...
?
Piotr Solnica
@solnic
there’s no built-in conveniences for this type of predicates yet
you could parameterize it for now
Aditya Tiwari
@aditya01933
like ?
Piotr Solnica
@solnic
unique?(field_name, value)
Aditya Tiwari
@aditya01933
ok