Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Gian D
    @fusillicode_twitter
    sure
    let me get them
    this is the output
    I've put a pp inside the blank rule to see the actual processed properties
    and it seems that I only get the property for which I have a validate call inside the struct under test
    Vlad Faust
    @vladfaust
    You could put pp into the validations code itself (the lib's) for debug purposes
    Gian D
    @fusillicode_twitter
    you're right
    Vlad Faust
    @vladfaust
    The issue is too broad for me now, please try to narrow it
    Gian D
    @fusillicode_twitter
    sure sure I totally understand ;)
    Vlad Faust
    @vladfaust
    Thank you
    Gian D
    @fusillicode_twitter
    ok I've found a solution
    but only by playing around blindly so beware I've still some missing knowledge to fill

    anyway with

    def validate
        previous_def
    end

    inside the shared validations module and

    def validate
        super
    end

    inside the structs that mixes the module it seems that everything works fine

    Vlad Faust
    @vladfaust

    Hm.

    def validate
        super
    end

    Doesn't make sense. If it compiles, it means validate is already defined

    And if removing

    def validate
        super
    end

    , specs fail?

    Gian D
    @fusillicode_twitter
    yes :(
    Vlad Faust
    @vladfaust
    That's a damn magic
    BTW, you want these gigantic specs to be included into the lib?
    Gian D
    @fusillicode_twitter
    well maybe it would help to have some reference regarding this case but I think that I need to clean them up
    they're somehow specific to a problem :)
    let me delete them and try to prepare a simpler example :)
    can I d?
    Vlad Faust
    @vladfaust
    If you adding a rule, add specs for it
    Gian D
    @fusillicode_twitter
    sure sure
    Vlad Faust
    @vladfaust
    And just for it
    If you catch a bigger bug, it's another issue and should be considered separately
    Gian D
    @fusillicode_twitter
    totally agree
    for now let me clean up this lobby from the gigantic code samples XD
    Vlad Faust
    @vladfaust
    And remember, when you're doing a PR, you create obligations for the maintainer to maintain your code onwards. So make sure the code is simple as possible
    Gian D
    @fusillicode_twitter
    👍🙇‍♂️
    Joakim Repomaa
    @repomaa
    hey @vladfaust
    i thought it's maybe easier if i write you here instead of going back and forth on the github issue
    Vlad Faust
    @vladfaust
    Yeah, hi, Joakim
    Joakim Repomaa
    @repomaa
    i'm not quite sure what you mean with the equals operator
    Vlad Faust
    @vladfaust
    Well, in your specs you're testing very basic language functionality -- whether did the DB variable changed
    I propose to write actual transaction call instead, it could be a simple SELECT 1 wrapped in a tx
    Just to make sure it works as intended
    Joakim Repomaa
    @repomaa
    ah ok
    it wouldn't compile if it didn't but ok :D
    so i should add those to exec_spec and query_spec?
    Vlad Faust
    @vladfaust
    Thanks. I would approve the PR, and would wait for the Crystal to upgrade to 0.30 before releasing
    Joakim Repomaa
    @repomaa
    sure, no rush
    Vlad Faust
    @vladfaust
    As exec and query do the same repo calls, only one place per db to test tx is enough. To be smart, you could put PG tx test in exec, and SQLite in query =)
    Joakim Repomaa
    @repomaa
    i'm just trying to find alternatives to crecto which isn't really being maintained anymore but is by far the most versatile orm i've seen. one thing that is hindering me from switching to Onyx::SQL is the lack of transaction support.
    Vlad Faust
    @vladfaust
    It would be super cool if you wrapped some actual TRANSACTION code in the query_spec, though
    Yeah, let's stick with that. Take some portion from */query_spec, and wrap, say, the post update, in a transaction -- for both DBs
    That would be the best
    Joakim Repomaa
    @repomaa
    alright
    Vlad Faust
    @vladfaust
    We're working on a language inspired by Crystal, which, apart from solving fundamental code issues Crystal has, would also aim for better ecosystem support. We hope this would solve the "not being maintained anymore" problem
    Joakim Repomaa
    @repomaa
    hm