by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 09 16:13
    charly starred dry-rb/dry-initializer
  • Aug 09 03:48
    slashpai starred dry-rb/dry-system
  • Aug 08 14:57
    bobwhitelock starred dry-rb/dry-types
  • 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
dan-klasson
@dan-klasson
    def key(name, &block)
      ::Kernel.warn 'key is deprecated - use required instead.'

      required(name, &block)
    end
docs are not updated?
Tim Riley
@timriley
@dan-klasson this isn’t released as a gem version yet
We have doc updates waiting on the releases.
dan-klasson
@dan-klasson
@timriley cool, thx
Tim Riley
@timriley
No probs!
dan-klasson
@dan-klasson
@timriley is master stable? is it safe to use?
Tim Riley
@timriley
I reckon so
Of course, you take a risk whenever you use master of anything, but AFAIK it’s fine here :)
panigrah
@panigrah

@timriley the following doesn't work on master any more. fails with a NoMethodError for 'key'

 require 'dry-validation'
 class Schema < Dry::Validation::Schema::Form
      key(:email) { |email| email.filled? }
  end

did the API change?

Tim Riley
@timriley
Yeah, it did.
required(:email).filled is whart you want now
dry-rb/dry-validation#99 is a decent summary
David Strauß
@stravid
@timriley upboated! Please keep writing them :)
Benjamin Klotz
@tak1n
ugh dry-rb/dry-types#78 :(
panigrah
@panigrah
@timriley In master - I also cannot extend Dry::Validation::Schema::Form as described in documentation - is that intentional? See my excerpt above. Thanks
Hannes Nevalainen
@kwando
@panigrah
Dry::Validation.Form{
  key(:email) { |email| email.filled? }
}
New syntax
panigrah
@panigrah
Thanks @kwando I wanted to know if the old syntax is supported or retired. Guessing it is retired
Hannes Nevalainen
@kwando
Yeah, it is retired =)
Tim Cooper
@coop
I wonder if it is worth adding a caluse to the README explaining that these docs are for master - checkout the appropiate release for the relevant docs.
I’m sure I’ve seen other projects do that.
Hannes Nevalainen
@kwando
:thumbsup: for that
dan-klasson
@dan-klasson
@coop actually the docs is for the latest release, not master
Tim Cooper
@coop
@dan-klasson the docs on the website are but I said README.md.
dan-klasson
@dan-klasson
@coop but there is nothing in the README
Tim Cooper
@coop

@dan-klasson

I wonder if it is worth adding a caluse to the README explaining ...

dan-klasson
@dan-klasson
... that these docs are for maste
r
Tim Cooper
@coop
Right, I feel like I wasn’t clear, I meant the docs in the README.
dan-klasson
@dan-klasson
hehe, but there are no docs in the README. that's why i'm totally confused right now :)
Fran Worley
@fran-worley
What would be amazing is to be able to view the docs on the website by release
Tim Cooper
@coop
That makes sense becauase the docs will only reference the current released version.
@fran-worley I believe Bundler does that.
Fran Worley
@fran-worley
I mean the dry-rb.org site
Tim Cooper
@coop
I know - I’m saying that bundler does something similar.
Fran Worley
@fran-worley
Ah didn't know that.
It might solve a lot of the syntax changing queries if people could view the docs on the site by version vs Master. e.g. http://dry-rb.org/gems/dry-validation/v-0.7.4
Tim Cooper
@coop
I like it.
Bundler just copy over the docs for each release - https://github.com/bundler/bundler-site/tree/master/source
Fran Worley
@fran-worley
Yeah, I'm talking about taking what is on the dry-rb site rather than the readme/docs for the repo itself
that way when versions get bumped and the docs/ examples on the site are changed those running old versions don't miss out
Tim Cooper
@coop
I totally get what you mean, I’m just linking to how bundler is doing it. Their docs site is generated from https://github.com/bundler/bundler-site. The dry-rb.org docs site is generated from https://github.com/dry-rb/dry-rb.org/.
Fran Worley
@fran-worley
Sorry, my brain is not engaging... I know understand what you mean!
I thought you meant that bundler does some magic with rubygem docs for versions... must get a :coffee: before I do anything else!
Tim Cooper
@coop
:P
Tim Cooper
@coop

@timriley I’ve been reading over your article again and I have a feeling that you meant to say that an Article is an entity not a value object. From your article you quote the definition of a value object as:

A value object is one whose notion of equality is based on the values of the attributes it contains, not its object identity.

I agree with this but your article class includes an id field:

class Article < Dry::Types::Struct
  attribute :id, Types::Strict::Int
  attribute :title, Types::Strict::String
  attribute :body, Types::Strict::String
end

I think we both will agree that Article.new(id: 1, title: “title”, body: “body”) != Article.new(id: 1, title: “amended title”, body: “body”) in code land but in the real world the objects are the same, they’re both referring to the exact same article (the second article is modified and therefore its title is different).

IMO a value object is something that is only identifiable by its attributes, things like money, name, address and credit cards.

I did enjoy the article though, just my 2 cents.

Simon Schmid
@sled
@coop :+1:
Tim Riley
@timriley
Good point, @coop. id being there is kind of a smell that it’s not a true value object.