In hanami guide https://hanamirb.org/guides/1.2/associations/has-many/#usage
when I use the method
@book = BookRepository.new.find_with_tickets(params[:id])
I got a message:
[deprecated] Relation#as will change behavior in 4.0. Use `map_to` instead
=> Called at:
/Users/saika/Documents/local/kadai-hanami/ticket_api/lib/ticket_api/repositories/book_repository.rb:7:in `find_with_tickets'
/Users/saika/Documents/local/kadai-hanami/ticket_api/apps/api/controllers/books/show.rb:9:in `call'
/Users/saika/.rvm/gems/ruby-2.4.0/gems/hanami-controller-1.2.0/lib/hanami/action/callbacks.rb:195:in `call'
/Users/saika/.rvm/gems/ruby-2.4.0/gems/hanami-controller-1.2.0/lib/hanami/action/callable.rb:71:in `block in call'
/Users/saika/.rvm/gems/ruby-2.4.0/gems/hanami-controller-1.2.0/lib/hanami/action/throwable.rb:145:in `block in _rescue'
/Users/saika/.rvm/gems/ruby-2.4.0/gems/hanami-controller-1.2.0/lib/hanami/action/throwable.rb:143:in `catch'
I do not know what should I instead use 'map_to'.
you should replace #as
with #map_to
, and it will work as usual.