Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Jeremy Woertink
    @jwoertink
    require "dotenv"
    
    Dotenv.load
    Dotenv.load! ".env.test"
    
    # prints out my .env value not the .env.test
    puts ENV["DATABASE_CONNECTION_STRING"]?
    Coding Concepts
    @codingconcepts
    Hi all, has anyone hooked up a CockroachDB database to their Lucky Framework site yet?
    Jeremy Woertink
    @jwoertink
    Hey! Welcome.
    I haven't seen anyone do that yet. I've never used cockroach before, so I'm not sure what all it would take
    But I imagine it's possible with a little conifg
    Coding Concepts
    @codingconcepts
    Hi @jwoertink
    It's wire-compatible with Postgres, so should be ok, the ability to use UUID IDs might be a stumbling block potentially but connecting with a URL should get around the need for the local Postgres app?
    Not managed it so far though...
    Jeremy Woertink
    @jwoertink
    Oh nice. UUIDs are supported in Avram, though not as "first class" as we'd like.
    But give it a shot, and let us know if you run in to issues. Someone around here should be able to help out 😅
    Coding Concepts
    @codingconcepts
    Will do, @jwoertink! Thank you.
    Harishkris
    @Harishkris

    Hi, I m starting my first lucky application development today. I followed the docs for setup. After initializing a new application, i did script/setup and finally it said, ✔ All done. Run 'lucky dev' to start the app. when i run lucky dev if get the following error,

    error Couldn't find a package.json file in "<pwd>/<app_folder_path>"
    12:25:07 web.1  | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

    I m trying to copy an exisiting package .json and run yarn install. but is there a way to generate it ( i m sure i m missing something ).

    Jeremy Woertink
    @jwoertink
    Hey @Harishkris ! Welcome to Lucky
    So you add the json file from another project and run yarn to get that error?
    Is that line"<pwd>" in there?
    Or was that just to redact what it actually said?
    I'd say make sure your json file is formatted properly
    You could run yarn init to make a new default package.json
    Then start with that and build from there
    Jeremy Woertink
    @jwoertink
    Has anyone here had any weird issues with Chrome / TurboLinks, and doing a redirect on logout?
    We have this issue where when a user tries to log out in chrome, it takes over a minute
    Screen Shot 2020-01-27 at 11.32.25 AM.png
    The whole action
    The logs show that Lucky actually responds really quick
    DELETE /logout
     â–¸ Handled by Login::Destroy
     â–¸ Ran verify_accepted_format
     â–¸ Ran set_cache_headers
     ▸ Sent 302 (79.0µs)
    but this only happens on Chrome. Even Brave, and Edge are fine.
    Sébastien Nadon
    @snadon
    I do remember that Turbolinks was causing me some troubles last year and I removed it. Something with the cache not clearing or something, so the page was not showing the proper values. And it was only happening on Chrome.
    Jeremy Woertink
    @jwoertink
    interesting. We're not using Turbolinks, but Lucky sets the header by default
    We tried removing that, and then testing, but still got the same result. I was really hoping it was just a turbolinks issue, but removing that header didn't seem to fix the issue
    Sébastien Nadon
    @snadon
    Currently my app is logging out properly on chrome. DELETE /sign_out
    Jeremy Woertink
    @jwoertink
    We may have just figured it out
    response.headers["Clear-Site-Data"] = %{"cache", "cookies", "storage"}
    We have this line in logout.
    Clearing the browser cache actually fixed it. So maybe chrome saw this header, and the cache was so large it just borked?
    Sébastien Nadon
    @snadon
    haha i don't know
    Sébastien Nadon
    @snadon

    I have a question with avram. I have a query that does full_text search and works well. However, I would like to retrieve the manager and director if any are found:

    employees = UserQuery.new
    .preload_manager
    .preload_director
    .preload_department
    .department_id.in(departments.map { |d| d.id })
    .where(search_department(queries))

    I know that I can filter while preloading but in this case I need it to be a OR. I suppose I don't have a choice but to make more queries? The thing is, the manager and/or director are not necessarily in the same department and I would like to avoid looping the results and send a bunch of queries.

    Jeremy Woertink
    @jwoertink
    Right now there's no built in OR. luckyframework/avram#54
    You'd have to hand write the SQL for that
    Sébastien Nadon
    @snadon
    my search_department method handles the OR but I cannot do something like OR manager.first_name since manager does not exist
    Jeremy Woertink
    @jwoertink
    ah.
    hmm. Yeah, that sounds like a tricky one
    Sébastien Nadon
    @snadon
    okay I'll handle this differently, probably create my own raw SQL for this
    Jeremy Woertink
    @jwoertink
    yeah, you could map that SQL to a separate object
    Sébastien Nadon
    @snadon
    since it's the global search action in the app it will be used a lot and I want to make sure it's not doing too many queries
    Jeremy Woertink
    @jwoertink
    That makes sense
    Harishkris
    @Harishkris
    @jwoertink Thanks. It works.
    Harishkris
    @Harishkris
    @jwoertink Is there a search engine integration (with ElasticSearch, Solr, etc) with lucky available?
    Jeremy Woertink
    @jwoertink
    I haven't seen anything yet