Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 12:45
    sadjow commented #344
  • Feb 20 17:31
    jswanner commented #141
  • Feb 20 06:15
    lazebny starred dry-rb/dry-types
  • Feb 19 22:35
    solnic commented #141
  • Feb 19 22:32

    solnic on v0.17.0

    (compare)

  • Feb 19 22:32

    solnic on master

    Bump dry-system to 0.17.0 (compare)

  • Feb 19 22:31

    solnic on 141-fix-compat-with-dry-configurable

    Bump dry-system to 0.17.0 (compare)

  • Feb 19 22:31

    dry-bot on master

    [devtools] update changelog.yml… [devtools] sync (compare)

  • Feb 19 22:27

    solnic on 141-fix-compat-with-dry-configurable

    (compare)

  • Feb 19 22:27

    solnic on master

    Fix compatibility with dry-conf… Merge pull request #142 from dr… (compare)

  • Feb 19 22:27
    solnic closed #142
  • Feb 19 22:27
    solnic closed #141
  • Feb 19 22:24
    solnic milestoned #141
  • Feb 19 22:23
    solnic opened #142
  • Feb 19 22:23

    solnic on 141-fix-compat-with-dry-configurable

    Fix compatibility with dry-conf… (compare)

  • Feb 19 21:12
    flash-gordon commented #141
  • Feb 19 20:45
    jswanner opened #141
  • Feb 19 20:45
    jswanner labeled #141
  • Feb 19 17:38
    pmackay starred dry-rb/dry-monads
  • Feb 19 17:18
    tomraithel starred dry-rb/dry-types
Vasilis Spilka
@vasspilka
I know I could just add "Metrics::" and the eval, but... I don't know seems like there should be a way to avoid that meta
Rafael
@lastk
it shouldnt be just: METRICS == { Messages => 30 } ?
Vasilis Spilka
@vasspilka
Well it could, but then the Ranking class that is in a different naming scope would fail to find them
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\"">>>