Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 10:50
    TomaszKot11 starred hanami/hanami
  • 08:48
    antslava starred hanami/hanami
  • Jan 22 01:19
  • Jan 20 23:17
    novikserg starred hanami/model
  • Jan 20 22:55
    novikserg starred hanami/controller
  • Jan 20 22:30
    giacomoguiulfo starred hanami/hanami
  • Jan 20 08:34

    jodosha on unstable

    Update rake to version 13.0.0 (… Rack 2.1 (#197) Ruby 2.7.0 (#198) and 4 more (compare)

  • Jan 19 15:45
    depfu[bot] labeled #193
  • Jan 19 15:45
    depfu[bot] opened #193
  • Jan 19 15:45

    depfu[bot] on update

    Update dry-validation to versio… (compare)

  • Jan 18 15:29
    FarizInk starred hanami/hanami
  • Jan 17 15:39
    webmstk starred hanami/hanami
  • Jan 17 10:21
  • Jan 16 02:19
    leateng starred hanami/hanami
  • Jan 15 10:47
    higsx starred hanami/hanami
  • Jan 15 10:21
    joelvh closed #290
  • Jan 15 10:21
    joelvh commented #290
  • Jan 14 17:23
    nadcns starred hanami/hanami
  • Jan 14 17:21

    jodosha on unstable

    Update rake to version 13.0.0 (… Rack 2.1 (#305) Ruby 2.7 (#306) and 4 more (compare)

  • Jan 14 16:35

    jodosha on develop

    Update rake to version 13.0.0 (… Rack 2.1 (#305) Ruby 2.7 (#306) and 3 more (compare)

Edouard
@inouire_twitter
@sebastjan-hribar cool, you're welcome
:star2: Happy new year to all the Hanami community ! :star2:
Edouard
@inouire_twitter
Thank you to all the contributors for the amazing work
Peter Saxton
@CrowdHailer
Hi everyone, Happy 2020.
I'm currently looking for places to talk to the "ruby community" in general. I love Hanami, even got to speak to Luca a few years back but am wondering is there any just ruby discussion forum?
Peter Saxton
@CrowdHailer
So I have built a Ruby integration for Kno (trykno.com) a service to do passwordless authentication. It is built as a rack middleware. Does a tutorial that covers sinatra also work for hanami or do you think I need a hanami specific guide https://github.com/trykno/kno-ruby
Edouard
@inouire_twitter
Hello Peter. I think a generic rack tuto is the best
I think that Hanami users are used to look for that kind of instructions
Edouard
@inouire_twitter
I will try your solution for a private family network I'm working on, looks interesting
Peter Saxton
@CrowdHailer
@inouire_twitter thanks for the feedback.
Do let me know how it goes for you. (peter@trykno.com if you want to message direct). We are working on the key integrations this week. Thinking PHP, Ruby, and NodeJS are probably the most useful for now. Then hopefully we are going to be able to go back to the core widget and really focus on nailing the UX
Edouard
@inouire_twitter
sure :thumbsup:
Bruno G. Souza
@Bgsouza_twitter
Hi,
Has anyone here used the EAV model on postgres inside Hanami?
I'm having trouble executing "CREATE TABLE <table> PARTITION OF <parent-table> FROM VALUES (..) to (..)"
I can't execute this raw query and no ORM or gem helped
Edouard
@inouire_twitter
I didn't know this concept, but this "just" a modelling pattern, right?
oh ok I didn't look closely at the query
Edouard
@inouire_twitter
What are you using to execute the raw query? Default hanami model?
Bruno G. Souza
@Bgsouza_twitter
Hi @inouire_twitter, I was trying to look for ways to execute this raw query. I even tried with 'repository.read ()', but it obviously didn't work
I changed my strategy, now I am using an out-of-scope hanami consumer who is solely responsible for performing partition creation
Sebastjan Hribar
@sebastjan-hribar
Does anyone have a list of validation errors? I remember dry-validation having a reference yaml for localization purposes, but I can't find it anymore. I'd need the list for all messages like "must be filled".
Sebastjan Hribar
@sebastjan-hribar

Can someone help with translating the default validation messages? Following the guides here I provide simple translation like this:

sl:
  errors:
    filled?: "mora biti izpolnjeno"

in the yaml file that is loaded by the I18N gem. The validations, however, don't pick the translation.

Brian Smith
@Lytol
anyone know what's the latest version of ruby supported by Hanami 1.3.3? the guide says 2.3+ but I'm pretty sure it won't work with 2.7.0.
Brian Smith
@Lytol
(I'll report back what I find by the way... just seeing if someone happened to know offhand)
Kai Kuchenbecker
@kaikuchn
@Lytol Official Support for 2.7 is in the works, for instance hanami-view should work with 2.7 out of the box, only throwing some deprecations: hanami/view#170
@CrowdHailer have you considered providing a warden-strategy for Kno? https://github.com/wardencommunity/warden
Kai Kuchenbecker
@kaikuchn
@sebastjan-hribar this spec shows that it should work. Have a look at the implementation of the DomainValidator here, maybe that helps you in figuring out what's going on?
It's possible that there is an issue here though, since not everything that's possible with hanami-validation is possible in the params validation block of hanami-controller, iirc.
David Dawson
@DangerDawson
Hoping someone can help me here, if I enable handle_exceptions any exceptions that happen in the view do not appear either in the stdout or sent to HoneyBadger, but if the exceptions are raised in the controller are. Is this expected? and if so, what is the best practices for understanding view exceptions with handle_exceptions enabled?
Sebastjan Hribar
@sebastjan-hribar

@kaikuchn Yes, I assume the spec and the fixture as in the links above are set up to be used in an interactor, right? The main difference being the validations define messages :i18n also seen here. There is no specific path defined for messages. While there is one when the validations block is used within the Paramsclass. You can see the same here in Hanami docs.

My use case is to have the 1. default messages translated after params are validated and then 2. process them again, prepending each one with the translation of the word field to avoid dealing with inflections.

The second part is implemented, but the error messages still need to be translated. As for i18n, it's implemented across multiple apps and works with no problem (implemented as already mentioned above: https://www.bounga.org/ruby/2016/10/08/using-i18n-with-hanami/).

Kai Kuchenbecker
@kaikuchn

Yes, I assume the spec and the fixture as in the links above are set up to be used in an interactor, right?

Well basically anywhere, where you include hanami-validation.

Sebastjan Hribar
@sebastjan-hribar
Yes, right, I've expressed myself poorly. I meant the two setups are different. I need to figure out the setup for params validation internationalization. I'll post back if/when I'm successful.
Sebastjan Hribar
@sebastjan-hribar

@kaikuchn I was overthinking it. The key issue lies with the messages method, where it should be enough this: messages :i18n. After trying a few things I went over the issues and I came across hanami/validations#129 and also the required workaround:

params do
  configure do
    config.messages = :i18n
  end
end

With this, the validations pick up translated messages.

NeupOrng
@NeupOrng
Hello,
I have one doubt before start the using hanami in the project.
Do we need the virtual environment for using this framework, or we just install it directly to our device?
thank you
btihen
@btihen
it intalls like any ruby project - like rails, sinatra, etc. Generally, you just need ruby, ruby gems & something like Nginx (configured to work with puma or unicorn). Digital ocean and othrers should have some good production deployment guides (at least for rails - it will be very similar)
Igor
@ircarreira

hi folks

my team has just started using Hanami recently for a new project. we've been meaning to use it for a long time. have a few fanboys of Hanami who were waiting for this to happen for a long time, so we're really happy so far

quick question: anyone knows of any similar initiative to brakeman that would work similarly for hanami?

Kai Kuchenbecker
@kaikuchn
Hi Igor, to the best of my knowledge no such gem exists. But maybe one of the framework independent security scanners, e.g., https://github.com/Arachni/arachni could also suit your needs?
Igor
@ircarreira
thanks Kai, arachni is great and equally useful in a different way. One of the things that is so convenient about brakeman is the ease of integrating with CI, which makes me wonder if there would be collective interest in investing in an alternative equivalent to brakeman that would work for Hanami
Jonathan Friedman
@jontonsoup
hi friends! I was wondering how module auto loading worked in the lib folder?
or should i be using require relative?
Jonathan Friedman
@jontonsoup
seems like require it is!
Kok Hung Cheah
@ckhung5

Hi.. I am new to Hanami and I am finding a way to write migration to set a column with a value. For example, I have created a new column(total) in savings table and I want to run a migration to calculate the total and fill into that column for each records in the database.

What usually you do and how do you it in Hanami?

sorry for silly question
Kai Kuchenbecker
@kaikuchn
Hey @ckhung5, welcome to the Chat. The use-case you are describing is often called "data migration" and should not be confused with a schema migration. The migration files you can generate with Hanami are supposed to be used for the latter only.
Some consider it an anti-pattern to perform data migrations through the vehicle of schema migrations. Cf. this post by thoughtbot on that issue, it is in the context of rails, but most points are valid for Hanami as well.
That begs the question what can you do? You can still perform data migrations through migration files, just make sure that you do NOT reference any code in your code base, because that code will change and potentially break the migration down the road.
Another way is to write a one-off rake task or some plain ruby script to perform the migration on your next deploy.
Heck, I sometimes even performed data migrations by logging into the database and firing a SQL statement, just do whatever works best for you and your use-case.
Celso Dantas
@celsodantas

friends, new to hanami here. Is there a good way that I can get Hanami::Router to route requests to different controller based on the MIME type but for the same path? ex: get /foo (mime: text/html) => HTML::Foo and get /foo (mime: application/javascript) => API::Foo.

I was able to get it working by passing a proc to the routing target and having the decision happen there, but I wonder if there's a prettier way?

sample:

get "foo", to: -> (env) do 
  if env[:request].html? 
    HTML::Foo.new.call(env)
  else
    API::Foo.new.call(env)
  end
end
unleashy
@unleashy
hey guys
has anyone tried to use Webpack with hanami? I really dislike the default Rails-like asset management hanami currently has
Huiming Teo
@teohm_twitter
Hi, I'm new to Hanami. Is there a scheduled timeline to promote unstable into stable release?
Specifically, I'm planning to migrate to ROM v5 in my production environment. But it seems like only Hanami unstable supports it.
Kai Kuchenbecker
@kaikuchn
@celsodantas I haven't tried to do that yet, so I'm not sure if it can out of the box. hanami-router uses http_router under the hood and basically adds a nice DSL, so if http_router can, then probably hanami-router can as well.
One surefire way to go about this is to have someone else rewrite your paths with the mime-type. I.e., /foo => /foo.json and then match on that. This could be done by a very simple rack middleware that you insert before the router middleware or by a reverse-proxy like nginx that sits in front of your app.
Kai Kuchenbecker
@kaikuchn
@unleashy this is something people keep asking about, so if you go ahead with it, please share with the community :)
Celso Dantas
@celsodantas
@kaikuchn thanks for the replay! the suggestion of the middleware is a good one.
unleashy
@unleashy
@kaikuchn oh, well, alright! I'll try my hand at it and report back if I get any meaningful progress :)
Paweł Świątkowski
@katafrakt
@unleashy you may want to look at webpacker-cli: https://github.com/danielpclark/webpacker-cli