by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jun 04 16:00
    italocomini starred hanami/hanami
  • Jun 04 12:14
    tosiooooooo opened #1057
  • Jun 03 20:36
    sovetnik starred hanami/model
  • Jun 03 15:46
    erzhtor starred hanami/hanami
  • Jun 03 15:31
    kaikuchn commented #196
  • Jun 03 10:07
    kaikuchn commented #196
  • Jun 03 09:09
    KagurazakaX starred hanami/hanami
  • Jun 02 17:25

    depfu[bot] on update

    (compare)

  • Jun 02 17:25
    depfu[bot] closed #364
  • Jun 02 17:25
    depfu[bot] commented #364
  • Jun 02 17:25
    depfu[bot] labeled #366
  • Jun 02 17:25
    depfu[bot] opened #366
  • Jun 02 17:21

    depfu[bot] on update

    Update rubocop to version 0.85.0 (compare)

  • Jun 02 14:33
    pmatsinopoulos commented #196
  • Jun 02 14:33
    pmatsinopoulos synchronize #196
  • Jun 02 14:22
    pmatsinopoulos synchronize #196
  • Jun 02 14:08
    pmatsinopoulos synchronize #196
  • Jun 02 11:37

    timriley on unstable

    (compare)

  • Jun 02 11:37

    timriley on unstable

    Hanami application integration … (compare)

  • Jun 02 11:37
    timriley closed #314
Jeff Dickey
@jdickey
Thanks again
Kai Kuchenbecker
@kaikuchn
Oh one other thing you could try is adding --network bridge to the docker build call.

The docker docs are a little thin on this flag.. API 1.25 says

Sets the networking mode for the run commands during build. Supported standard values are: bridge, host, none, and container:<name|id>. Any other value is taken as a custom network's name to which this container should connect to.

docker build --help says

--network string Set the networking mode for the RUN instructions during build (default "default")

Jeff Dickey
@jdickey
yeah, that makes sense, too, and it's a cheap thrill. But I thought bridge was the default
Kai Kuchenbecker
@kaikuchn
So maybe bridge which I'd have thought was the default, isn't?
Jeff Dickey
@jdickey
oops; nope; I'll give it a try
Kai Kuchenbecker
@kaikuchn
My guess is that the docs are wrong and bridge is actually the default..
Otherwise how can you pull packages etc?
A sanity check I like to perform when I cannot establish a connection is this:
service="0.0.0.0/5432"; (timeout 1 bash -c "cat < /dev/null > /dev/tcp/$service" && echo "Success opening remote port") || echo "Could not connect"
This just checks whether a port is open without needing to install special networking tools.
Jeff Dickey
@jdickey
Right; that's a good one. I'll swipe that :grinning:
Sebastjan Hribar
@sebastjan-hribar

We're currently setting up the internationalization project wide and I found these resources: https://www.bounga.org/ruby/2016/10/08/using-i18n-with-hanami/ and https://github.com/ippachi/hanami-i18n

Since there is still no updates hanami/hanami#610 we'll go with the above gem. Can we tie the locale to a setting entity so admins could change the locale per each end user company?

Jeff Dickey
@jdickey
@kaikuchn Well, --network bridge had no discernible effect; on to the entrypoint
Kai Kuchenbecker
@kaikuchn
@jdickey who knows how semaphore makes the service available to you, probably service endpoints just aren't accessible for the docker daemon.. So entrypoint is a good way to just not fight that particular battle.
Jeff Dickey
@jdickey
Makes sense; I'll give it a try and ping their support if I don't get it in a day or so. Thanks for all your help
Kai Kuchenbecker
@kaikuchn
Good luck. Always happy to help.
Paweł Świątkowski
@katafrakt
@sebastjan-hribar I guess you need to set appropriate I18n.locale = locale_from_setting before every action, but it's definitely doable.
kristjan-brezovnik
@kristjan-brezovnik
Hi! I'm completely new to Hanami and basically only style the frontend. To that effect, I would like to use the LESS preprocessor. I've looked though the manuals, but can't seem to figure out what exactly I'm doing wrong. In my 'app/testapp' folder I have downloaded the 'less.js' file and put it under 'assets/javascripts' and in my 'styles.css.less' stylesheet (under 'assets/stylesheets') I put a very simple #header{font-weight: bolder;} declaration to test it. I've also added <link rel="stylesheet/less" type="text/css" href="styles.css.less" /> and <script src="less.js"></script> tags to the app's 'application.html.erb' file. The style is not applied, so now I'm a bit lost. Anyone have any experience with LESS or can point me in the right direction? I could work with SASS or SCSS, if it's easier.
Sebastjan Hribar
@sebastjan-hribar
@katafrakt thank you, will try that. Will have to rethink the use case though if it's worth implementing, since it would effectively not be changed often is at all for one end user. Might as well make the config before deploy.
Sebastjan Hribar
@sebastjan-hribar
@katafrakt On a second note if we setup an AJAX call to a language selector on the UI then users could also make adhoc locale changes, provided we set locale before each action.
Ivan Rubanovskiy
@xvonabur
Hi! Does Hanami supports composite keys in hanami-model? I saw old issue on GitHub, but it's 2 years old: hanami/model#432
Kai Kuchenbecker
@kaikuchn
Folks, I just learned that Ruby 2.7 preview has Enumerator.produce and I'm loving it. Why isn't there more noise about this absolutely fantastic (experimental) addition to Ruby? Check it out
With this I'll never have to write a while loop again x)
Matt
@matt-from-toronto
i just took a look through the guide, hanami looks frickin awesome. congrats all! really love how repositories and entities are separated (i hate models in rails), and love the interactors concept too, callbacks have been very painful for me to work with
i'd love to know what are the some impressive apps built using hanami that are currently being used in production. i've taken a look through http://awesome-hanami.org/#awesome-hanami-hanami-project-list and am wondering if there's more to add to that list
calebbarde
@calebbarde
Hi all - a silly question likely - but coming from Rails and AR, I'm used to validation at both a request level and a model level. Is it idiomatic in hanami to have entity validations (in additions to the automatic schema validations)?
Is there an "idiomatic" hanami project on http://awesome-hanami.org/#awesome-hanami-hanami-project-list (stolen from @matt-from-toronto :) ) that would be a good one to reference overall?
Matt
@matt-from-toronto
@calebbarde you can add custom scheme validations to an entity it seems. https://guides.hanamirb.org/entities/custom-schema/ what validation do you want to add that can't be covered by schema validations, whether automatic or custom?
actually I think I've misunderstood your question
I'd also love to know if there's an idiomatic hanami project, I haven't stumbled across one yet FWIW
calebbarde
@calebbarde

Ah yes I saw that - I was interested as to that - a note there

Custom schema takes precedence over automatic schema. If we use custom schema, we need to manually add all the new columns from the corresponding SQL database table.

Which is unclear to me. If I use custom schema attributes, does it completely override the other columns? Or can I use both - sometimes its just nice to have some overlying business logic validations to ensure bad data cannot enter the persistence layer at that boundary

Hah I feel you on the hanami project search, I really enjoy the ideas of Hanami, but its small compared to rails obviously :)
Sebastjan Hribar
@sebastjan-hribar
I'm getting a strange error: Sequel::InvalidValue at ArgumentError: no time information in ""
When trying to create or read the affected entity. The entity has two DateTime attributes describing the start and end of contractual relationship. I can't find to many useful resources online. In migration, these fields are defined the same as the default ones for created_at and updated_at. Can someone shed some light on this?
Sebastjan Hribar
@sebastjan-hribar
slika.png
Sebastjan Hribar
@sebastjan-hribar

This is the error stack, the top of it, at least...

I've just moved db to postgres and it works fine. Any thoughts? I'd like to keep to sqlite for dev.

Kai Kuchenbecker
@kaikuchn
@calebbarde I think the guides do mention that validation at the model level is way too late and instead in Hanami it is idiomatic to validate at the boundary (i.e., in the action or an interactor to which the action delegates.) Should be mentioned somewhere here
So instead of accepting anything, and handling all possible values everywhere throughout a workflow and only validate when writing to the database, we first validate that inputs adhere to our expectations and then start the workflow which becomes so much simpler and less error prone.
As for an idiomatic example application.. I dunnow x(
There is https://snippets.hanamirb.org/ as a repository for example solutions to common problems
But it's still rather thin.. I really need to write more snippets x)
If in doubt just ask here and people will discuss solutions
Sebastjan Hribar
@sebastjan-hribar
RE my Sequel error: the same code with same gems works on one machine and not on another.
Kai Kuchenbecker
@kaikuchn
Different version of SQLite then?
Kai Kuchenbecker
@kaikuchn
Maybe one system uses 32bit version, other uses 64bit, or some such difference
Kai Kuchenbecker
@kaikuchn
Another possible cause is the data that's in the DBs (if any). If you look at the quirks of SQLite the flexible typing sticks out as a possible cause.. https://www.sqlite.org/quirks.html
I mean SQLite does not have a separate Datetime datatype and instead may store such data as text, int or real.
The error you receive looks like it's text in your case and that there's a row that simply contains no information
Sebastjan Hribar
@sebastjan-hribar
@kaikuchn I've checked everything above you mentioned and after applying the same DateTime format as described in the quirks and as used by the default created_by, it works on my machine. Before it didn't work even with date picker w/o any manual input. We'll probably move to postgres since we'll have a lot of dates and times to deal with. However, it's still unclear why different formats work differently on different machines.
Kai Kuchenbecker
@kaikuchn
I generally don't recommend using different databases between development, test, staging and production. Of course you're not going to employ a 25 node, sharded, highly available Cluster in development but one should still strive to have an environment as similar as reasonably possible between stages.
That way one can catch errors/problems early and many other problems that occur by having differences between environments can be circumvented.