Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Feb 26 16:22
    karpinovsky starred dry-rb/dry-auto_inject
  • Feb 26 16:22
    karpinovsky starred dry-rb/dry-container
  • Feb 26 16:22
    karpinovsky starred dry-rb/dry-matcher
  • Feb 26 16:22
    karpinovsky starred dry-rb/dry-monads
  • Feb 26 16:22
    karpinovsky starred dry-rb/dry-initializer
  • Feb 26 16:21
    karpinovsky starred dry-rb/dry-system
  • Feb 26 16:21
    karpinovsky starred dry-rb/dry-types
  • Feb 26 14:03
    solnic commented #143
  • Feb 26 13:19
    davydovanton commented #143
  • Feb 26 13:04
    solnic commented #143
  • Feb 25 23:58
    davydovanton review_requested #143
  • Feb 25 23:56
    davydovanton synchronize #143
  • Feb 25 23:56

    davydovanton on strategies-fail

    Fix error with mutation of froz… (compare)

  • Feb 25 22:40
    davydovanton review_requested #143
  • Feb 25 22:40
    davydovanton review_requested #143
  • Feb 25 22:40
    davydovanton assigned #143
  • Feb 25 22:40
    davydovanton opened #143
  • Feb 25 22:40
    davydovanton review_requested #143
  • Feb 25 22:40
    davydovanton labeled #143
  • Feb 25 22:34

    davydovanton on strategies-fail

    Fix error with mutation of froz… (compare)

Vasilis Spilka
@vasspilka
Hmmm... I guess I could restructure the order of the modules.. but.. owww I just want better namespace handling :'( :sob:
Vasilis Spilka
@vasspilka
seems I can do this metric = Object.const_get("Metrics").const_get(metric.to_s), hurts my eyes
Vasilis Spilka
@vasspilka
Hmmm... thats interesting... turns out I'm a whiny prick and it worked all along like you mention @lastk.
I must have been doing something different earlier or was just ignorant.. sry
Rafael
@lastk
haaha, np :)
Andy Holland
@AMHOL
@vasspilka pretty sure you can write that like: Metrics.const_get(metric)
Ralf Schmitz Bongiolo
@mrbongiolo
On dry-validation, when using rules inside an array why they don't return the item index like other errors?
Ex: {:should_have_investment_rate_only=>["must be filled", "must be filled", "must be filled", "cannot be defined"], 2=>{:minimum_investment=>["is missing"]}}
The rule :should_have_investment_rate_only return an array of error messages, but it's not possible to know if it was on item 1,2 or 42..
Tim Riley
@timriley
@mrbongiolo that sounds like a bug to me. Worth filing a GH issue?
Ralf Schmitz Bongiolo
@mrbongiolo
I'll do it @timriley
Tim Riley
@timriley
Thanks!
Abinoam P. Marques Jr.
@abinoam
Hi @vasspilka . Im a little late at the conversation and im lacking context. Where is Metrics::Messages being defined? It seems it's just being resolve inside the METRICS hash definition.
Maciej Mensfeld
@mensfeld
hello
+egl?+ is not a valid predicate name
any idea?
aaaa
sorry
eql
typo
damn
:) works like a charm
Alessandro Desantis
@aldesantis
Hello guys! I am trying to distribute my own set of Dry::Validation predicates. I just made a predicate container and the use can call predicates in the configure block to use them, but I can't figure how to distribute the messages.
There does not seem to be a way to add messages to the current ones?
Christopher Dennl-Ortega Arrieta
@cdennl
@alessandro1997 messages file
it is in the docs
Darin Haener
@dphaener
Hello!
Philip Arndt
@parndt
How should I deal with validating a hash that has string keys when my validator looks like required(:field_type) and I have {"field_type" => "value"}?
Tim Riley
@timriley
@parndt use a form schema? Dry::Validation.Form do ...
Form schemas are designed to expect stringy keys and do various other coercions
Philip Arndt
@parndt
@timriley nice, thanks! I was just using a .Schema
Philip Arndt
@parndt
@timriley {:errors=>{:content_type=>{:field_schema=>{:author=>{:field_type=>["must be filled"]}}}}} :+1:
Tim Riley
@timriley
@parndt hooray!
Philip Arndt
@parndt
Can anybody point me to anything to do with dry & JSONB querying in postgres? Or is this purely the domain of sequel?
Tim Riley
@timriley
dry-rb doesn't offer any database libraries - I'd suspect you could use the raw sequel DSL through rom-rb though
Philip Arndt
@parndt
thanks :)
Tim Riley
@timriley
Through rom-sql, I really mean
Tim Riley
@timriley
You're looking to do a special JSON-based query though, yes? I'm not sure those PG types in rom really give you that
Philip Arndt
@parndt
yeah.. I want to do this:
SELECT * FROM contents WHERE value_schema @> '{"slug": "my-slug"}';
Tim Riley
@timriley
Yeah. I guess see what sequel would give you.
Philip Arndt
@parndt
yup, thanks :) will do
it's nice having to think about all of this, but ActiveRecord sure does have a lot built in to its public API ;)
Philip Arndt
@parndt
@timriley easy to do it unsafely with hanami inside the repository:
def find_by_slug(slug)
  contents.where(%Q{value_schema @> '{"slug": "#{slug}"}'}).as(:entity).one
end
contents.where { value_schema.pg_jsonb.contains("slug": slug) }
:+1: thanks @solnic for your comment which revealed the answer for me
Piotr Solnica
@solnic
@parndt that’s rom-sql 1.0.0.beta*
oh wait right, your example is plain sequel, this works in 0.9.x
Philip Arndt
@parndt
Yeah :D
 @relation=
  #<ROM::Relation[Contents] dataset=#<Sequel::Postgres::Dataset: "SELECT \"id\", \"content_type_id\", \"value_schema\", \"created_at\", \"updated_at\" FROM \"contents\" WHERE (\"value_schema\" @> '{\"slug\":\"my-page\"}'::jsonb) ORDER BY \"contents\".\"id\"">>>
pretty happy with that :)
Piotr Solnica
@solnic
cool stuff huh? sequel kicks ass, and rom-sql 1.0.0 even makes it better
Philip Arndt
@parndt
yeah!! I am agreeing with you now