depfu[bot] on check
depfu[bot] on check
timriley on require-ruby-3.0
timriley on main
Require Ruby 3.0 (#1141) (compare)
is anybody aware of an issue with the "Getting Started" guide? I'm working through it and am just before "Displaying Validation Errors", and then I hit this issue with Hanami booting:
An error occurred while loading spec_helper. Failure/Error: Hanami.boot NoMethodError: undefined method `size' for nil:NilClass # /home/x/.rbenv/versions/2.7.4/gemsets/hnm/gems/dry-validation-0.11.0/lib/dry/validation/schema/deprecated.rb:11:in `input_processor' # /home/x/.rbenv/versions/2.7.4/gemsets/hnm/gems/dry-validation-0.11.0/lib/dry/validation/schema/class_interface.rb:165:in `default_options' # /home/x/.rbenv/versions/2.7.4/gemsets/hnm/gems/dry-validation-0.11.0/lib/dry/validation/schema/class_interface.rb:35:in `new' # /home/x/.rbenv/versions/2.7.4/gemsets/hnm/gems/hanami-validations-1.3.7/lib/hanami/validations.rb:109:in `validations' # /home/x/.rbenv/versions/2.7.4/gemsets/hnm/gems/hanami-controller-1.3.3/lib/hanami/action/params.rb:152:in `params' # /home/x/.rbenv/versions/2.7.4/gemsets/hnm/gems/hanami-controller-1.3.3/lib/hanami/action/validatable.rb:100:in `block in params' # /home/x/.rbenv/versions/2.7.4/gemsets/hnm/gems/hanami-controller-1.3.3/lib/hanami/action/validatable.rb:100:in `class_eval' # /home/x/.rbenv/versions/2.7.4/gemsets/hnm/gems/hanami-controller-1.3.3/lib/hanami/action/validatable.rb:100:in `params' # ./apps/web/controllers/books/create.rb:9:in `<class:Create>' # ./apps/web/controllers/books/create.rb:4:in `<module:Books>' # ./apps/web/controllers/books/create.rb:3:in `<module:Controllers>' # ./apps/web/controllers/books/create.rb:2:in `<module:Web>' # ./apps/web/controllers/books/create.rb:1:in `<top (required)>' # /home/x/.rbenv/versions/2.7.4/gemsets/hnm/gems/hanami-utils-1.3.8/lib/hanami/utils.rb:56:in `require_relative' ...
This is most unexpected. I've dug through some of the gems... and arrived at dry-validation-0.11.0/lib/dry/validation/schema/deprecated.rb, where this is the offending line (apparently
type_map is not expected to be nil):
elsif type_map.size > 0 && config.input_processor != :noop
I don't know where type_map is set though
Hi all, I'd like to ask for you input on this use case: I'd like to move some rake tasks to UI actions. These tasks import CSV data, parse them and create DB records. Currently admin needs to run these inside the container. Since these need to be run more than once I need to make things simpler. The CSV files do not need to be stored on the server. So I'm thinking to have a file selection UI element that reads the file into memory and does the same processing as the rake tasks.
So I would use JS to read in the file and pass it in memory as a param to an interactor on a designated action. Is this the way to go? And should I take any special security measures?
Edit: @sebastjan-hribar what about the size of the file? Won't it be a memory issue if you'd work with big files? I see it as a bit risky if you need to load all the content without checking the max file size first. I would still save the file on the server, even in the temporary storage, and clean it up after processing finishes. This way I would introduce two endpoints, for file upload creation, and the second one for processing it. You could still merge those endpoints if that's a requirement.
PS: Sorry for typos in my original message, I really need to stop answering from mobile :)
Hello! :) i have few questions following custom helpers
i notices changing order of
load_paths impacts code loading, if i add 'helpers' dir last:
load_paths << [ 'controllers', 'views', 'helpers' ]
then my Helper's don't get loaded, i get
uninitialized constant Web::Helpers during
How do you gyus test helpers? Some helpers i have are dependent on
Now I created a
DummyView and test this helper the same way as view, but maybe it would be possible to test this helper in isolation? some ideas? :)
question: i want to add 'log out' link. I have DELETE route for destroying user's session. I want to add it on template, in navbar, but it has to be form (as i need to make DELETE request). But then unit test for Layout fails, because of form helper:
NoMethodError: undefined method `params' for #<Web::Views::ApplicationLayout:0x000055b1bfa7b1a8>
Some ideas? I could change route for GET and use normal link. Or try to disable CSRF protection somehow maybe? Or fix my test somehow :)
Folks, as you may have read in the alpha3 announcement, we’re going to release :point_right: monthly alphas :point_left:.
So far the alpha releases were scope bound :chart_with_upwards_trend:.
When the scope was developed, we used to release it.
Now that the ground work is done (thanks Tim :pray: ), we can change the release strategy and make it time bound :stopwatch:.
Once a month, we :shipit: a new alpha, with the improvements that we made since the previous release.
This puts us in a position to release often and build momentum. :fire:
We will focus on the cleanup of the application template. https://github.com/hanami/hanami-2-application-template
The template is a working Hanami 2 app.
By cleaning up it, we can reverse engineer what we need to implement in the framework.
:call_me_hand: If you want to contribute to Hanami, please start from the application template needs, and the work backward to enhance Hanami.
This is my first part of my yesterday's question. I've removed the gem list:
I'm experiencing a really odd issue. I'm getting
TypeError at no implicit conversion of Integer into String for this line:
session[:session_start_time] + @validity_time.to_i < Time.now. This started on a development branch where the only change that might impact this is the
gemfile.lock. On master,
session[:session_start_time] is a
NilClass and on the development the
session[:session_start_time] is a String class. I did delete the
gemfile.lock on the development and ran a fresh bundle install. The
session[:session_start_time] is set as
I've checked Tachiban and irb for the comparison and it runs fine, as well as on the master branch.
Now for the solution:
I've found the culprit. It was
hanami 1.5.0. Reverting it back to
hanami 1.3.0 solves the problem. Now I don't know, does this qualify for an issue for Hanami or Tachiban?
scopewith path parameters feels a bit lonely. hanami/api#29
Hey, sorry if it's been asked before. 1 day into Hanami
Is there a good hanami 2 app example with project structure?
Found https://github.com/hanami/hanami-2-application-template but it seems it doesn't have all the entities
Yo guys, quick question. Does hanami2(rom, sequeel) support psql yet?
When I run:
bundle exec hanami db create_migration apples
/src/vendor/bundle/ruby/3.0.0/gems/hanami-cli-2.0.0.alpha3/lib/hanami/cli/commands/db/utils/database.rb:32:in `block in ': psql is not a supported db scheme (RuntimeError)