These are chat archives for dry-rb/chat

Jun 2018
Piotr Solnica
Jun 27 2018 09:37
as long as gems are < 1.0, switching versions in docs is not needed
tbh, moving docs to individual project repos is a more important to-do at the moment
Igor S. Morozov
Jun 27 2018 10:15

Alright, no need to add versions right now. Thank you!

I’ll add CI within two weeks, that should help with moving docs to individual repos. is hosted on Heroku, right?

Nikita Shilnikov
Jun 27 2018 10:23
it’s hosted on GH
wrt, CI I know @davydovanton has a solution for this
I believe you can ping him
Jaromír Červenka
Jun 27 2018 10:29
Re CI - I can offer virtual servers if needed (hdd/ssd, 1Gbs, IPv4/IPv6) in central europe
Igor S. Morozov
Jun 27 2018 10:34

Oh, I see. Thought it was hosted on GH Pages first, but then noticed the Procfile. This stuff is confusing

Thanks for the heads up, I’ll talk to Anton

Jaromír Červenka
Jun 27 2018 17:42
Hello :) I am testing example of scoped_unique? from but I am not successful. Can you see anything I may have missed, please? I am unable to get three arguments to the scoped_unique? method.
module Users
  UserSchema = Dry::Validation.Schema do
    configure do
      option :record

      def scoped_unique?(attr_name, scope, value)
        record.class.where.not(id: => value).empty?

    required(:email).filled(scoped_unique?: [:email, { active: true }])
[7] pry(main)> reload!; Users::UserSchema.with(record:{email: ""})
ArgumentError: wrong number of arguments (given 2, expected 3)
from /Users/cervajz/Projects/Personal/Ruby/virtio/api/app/schemas/users/user_schema.rb:6:in `scoped_unique?'
[8] pry(main)>
Jaromír Červenka
Jun 27 2018 17:51
When changed to method with just two arguments:
[3, 12] in /Users/cervajz/Projects/Personal/Ruby/virtio/api/app/schemas/users/user_schema.rb
    3:     configure do
    4:       option :record
    6:       def scoped_unique?(attr_name, value)
    7:         byebug
=>  8:         record.class.where.not(id: => value).empty?
    9:       end
   10:     end
   12:     required(:email).filled(scoped_unique?: [:email, { active: true }])
(byebug) attr_name
[:email, {:active=>true}]
(byebug) value