https://avo.cool logo
Join Discord
Powered by
# avo-2
  • l

    lively-kitchen-58021

    10/26/2021, 1:53 PM
    Oh, sorry I hadn't seen it
  • l

    lively-kitchen-58021

    10/26/2021, 1:53 PM
    Thank you so much
  • l

    lemon-wall-20836

    10/26/2021, 1:53 PM
    no worries
  • l

    lemon-wall-20836

    10/26/2021, 1:53 PM
    for sure
  • q

    quaint-pencil-2979

    10/29/2021, 2:31 PM
    Good morning, @User.I am working in a project with @User and we have trouble with an uncountable model name. The model name is Library::Media, the main problem is, when avo generates the routes they add index to the route, like:
    Copy code
    resources_library_media_index_index GET    /resources/library_media_index(.:format)   avo/library_media_index#index                   new_resources_library_media_index GET    /resources/library_media_index/new(.:format)  avo/library_media_index#new
    Because in this line of app#draw_routes: resource.model_class.model_name.route_key returns "library_media_index" and should returns library_media we have added:
    inflect.uncountable 'library_media'
    to inflections.rb
  • l

    lemon-wall-20836

    10/29/2021, 2:35 PM
    hi Duepe
  • q

    quaint-pencil-2979

    10/29/2021, 2:35 PM
    Maybe we can use singular_name method
  • l

    lemon-wall-20836

    10/29/2021, 2:36 PM
    first of all... is this a new project or an old one? The best way of fixing this would be to rename the model to
    library_media_item
    (even the rails docs mention something about naming models)
  • l

    lemon-wall-20836

    10/29/2021, 2:36 PM
    regarding
    inflect.uncountable 'library_media'
    it should work
  • l

    lemon-wall-20836

    10/29/2021, 2:36 PM
    I would check that area to see why it doesn't workπŸ‘†
  • l

    lemon-wall-20836

    10/29/2021, 2:36 PM
    I mean... it worked with the prerelease version, right?
  • q

    quaint-pencil-2979

    10/29/2021, 2:37 PM
    Thanks for the support!! Its a old project
  • q

    quaint-pencil-2979

    10/29/2021, 2:37 PM
    Pedro tests with pre release and works, i will try now too
  • l

    lemon-wall-20836

    10/29/2021, 2:37 PM
    sure
  • l

    lemon-wall-20836

    10/29/2021, 2:37 PM
    perfect! thanks!
  • q

    quaint-pencil-2979

    10/29/2021, 2:38 PM
    This method:
    LibraryMediaResource.model_class.model_name.route_key,
    should returns library_media_index or library_media?
  • l

    lemon-wall-20836

    10/29/2021, 2:38 PM
    library_media
  • l

    lemon-wall-20836

    10/29/2021, 2:38 PM
    I mean... IDK πŸ™‚
  • l

    lemon-wall-20836

    10/29/2021, 2:39 PM
    if it's uncountable,
    library_media
    I think
  • h

    helpful-microphone-19711

    10/29/2021, 2:42 PM
    Hey @User ! What should I do to build my fork of Avo so that I can use it locally before submitting a PR?
  • l

    lemon-wall-20836

    10/29/2021, 2:44 PM
    hmm. we don't have a comprehensive guide for that but we do have a
    CONSTRIBUTING.MD
    file
  • l

    lemon-wall-20836

    10/29/2021, 2:46 PM
    1. clone 2.
    cp spec/dummy/.env.sample spec/dummy/.env
    3.
    docker-compose up
    for the database 4.
    RAILS_ENV=test bin/rails db:setup
    5.
    rake test
    to run tests
  • l

    lemon-wall-20836

    10/29/2021, 2:46 PM
    6.
    AVO_ADMIN_PASSWORD=secret bin/rails db:seed
    to seed the DB for development
  • l

    lemon-wall-20836

    10/29/2021, 2:47 PM
    I'm here to help as well if anything doesn't work
  • h

    helpful-microphone-19711

    10/29/2021, 2:51 PM
    Cool, I'll play around a bit and see if I can get it working. Just a heads up, there doesn't appear to be a committed sample .env file.
  • q

    quaint-pencil-2979

    10/29/2021, 2:57 PM
    Not works for me, i guess pedro changes the source code in his machine and works because that. I saw your explanation for not use gsub _index, i agree with you. I guess we can use this method https://api.rubyonrails.org/classes/ActiveModel/Naming.html#method-c-singular_route_key, to generate route key for draw_routes. I will make a PR for that and thanks again for the support!!
  • l

    lemon-wall-20836

    10/29/2021, 2:57 PM
    for sure
  • l

    lemon-wall-20836

    10/29/2021, 2:58 PM
    hmmm... adding one now πŸ™‚
  • l

    lemon-wall-20836

    10/29/2021, 2:59 PM
    this is so weird. I have one on my machine and it's not git ignored
  • l

    lemon-wall-20836

    10/29/2021, 2:59 PM
    oh. it's in the dummy app. who's the dummy now?
1...171819...64Latest