Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 08:26
    Mukesh23singh starred hanami/view
  • Jan 22 20:22
    depfu[bot] labeled #613
  • Jan 22 20:22
    depfu[bot] opened #613
  • Jan 22 20:22

    depfu[bot] on update

    Update dry-types to version 1.5… (compare)

  • Jan 22 20:17
    depfu[bot] labeled #169
  • Jan 22 20:17
    depfu[bot] opened #169
  • Jan 22 20:17

    depfu[bot] on update

    Update dry-struct to version 1.… (compare)

  • Jan 22 17:59
    pzgz starred hanami/router
  • Jan 22 14:45
    bozhenaboichuk starred hanami/hanami
  • Jan 21 21:44
    jodosha commented #211
  • Jan 21 21:44
    jodosha milestoned #211
  • Jan 21 21:44
    jodosha labeled #211
  • Jan 21 21:43
    jodosha review_requested #211
  • Jan 21 21:43
    jodosha assigned #211
  • Jan 21 16:06
    geordidearns starred hanami/model
  • Jan 21 13:45
    graudeejs review_requested #210
  • Jan 21 12:50

    depfu[bot] on check

    (compare)

  • Jan 21 11:48

    depfu[bot] on check

    Pin concurrent-ruby to version … (compare)

  • Jan 21 08:56
    vanyavasylyshyn starred hanami/hanami
  • Jan 19 18:44
    joshfng starred hanami/router
thatguysimon
@thatguysimon
Unless you want to see actual code..
Sven Schwyn
@svoop
@thatguysimon Sorry for the confusion, I ment "follow the work on Hanami 2 code" rather than the roadmap on Trello.
thatguysimon
@thatguysimon
Is Hanami participating in Hacktoberfest? https://hacktoberfest.digitalocean.com/
Paweł Świątkowski
@katafrakt
@svoop yes, unstable is where hanami 2 happens
Sebastjan Hribar
@sebastjan-hribar
How would I get the controller for each action?
Sebastjan Hribar
@sebastjan-hribar
The use case for getting the controller info is a before call for each action to see if the user is authorized.
Vítor Avelino
@vitoravelino
hi! anyone knows open source apps that are still being maintained? the ones I find are usually abandoned or stagnant.
Sebastián Delgado
@sebasdeldi
Hi guys
Yuriy Tsemashko
@azzz
Hi there!
Kuchaev Ilya
@Ilya-Kuchaev
Screenshot 2020-11-02 at 13.50.14.png
The project is somehow alive, but it's not very optimistic )
One year from the latest release!
Viktor
@skcc321
release per year is almost non maintained.
Edouard
@inouire_twitter
Actually the team is working hard on v2
Armin
@wuarmin

Actually the team is working hard on v2

:thumbsup:

Yuriy Tsemashko
@azzz

Hi. Please help me to understand how to organize my architecture better. Imagine I have a feature that requires to touch several repositories, models and so on. For example, I have a function CreateTransaction(from_account, to_account, amount) which does the next things: create debit Transaction on to_account, create credit Transaction of from_account. This operation has some restriction: the amount cannot be 0 or negative, the accounts should be different and so on. So, I need some validations.

The validations are described only in scope of actions (I like having data validations dependent on ,let's say, the protocol level). But of course the CreateTransaction logic must not be implemnted in an action as it might be used from several protocols: from web gui, from json API, from protobuf api and so on

what would be is the right choice of how to implement my CreateTransaction?
as Hanami uses dry-rb a lot, I'm looking at dry-rb gem. I found dry-struct. If I include some validations into my class which extends Dry::Struct, i can build pretty nice business function

But of course I can create just my own class with an instance method "call" and put some if conditions:

class CreateTransactionOperation
def initialize(from, to, amount)
end

def call
return :error_1 if amount <= 0
return :error_2 if from == to

begin_transaction
bla bla bla
bla bla
commit_transaction
end
end

and it will work obviously.

Yuriy Tsemashko
@azzz
but is there a ready-to-use solution?
Brett Dudo
@dudo
Hello, folks! I've been working with hanami-api, and it's getting large. I'd like to move to controllers. Is that pretty straight forward? Anything to add to the initializers to auto require all the controller files?
to clarify, I'd like to do api + controllers
this example in the api readme is the only thing that touches on it get "/users", to: Actions::V1::Users::Index.new
Brett Dudo
@dudo
and where should I call Hanami::Controller.load!?
Brett Dudo
@dudo
image.png
image.png
tinkering with folder structure
image.png
Sebastjan Hribar
@sebastjan-hribar
@azzz we have a similar use case, where we had to implement touching multiple repos, doing some checks, catching exceptions and so forth. We now have all business logic for this in an interactor. For example, a request comes in through ajax to an action that calls this interactor. Have a look here to see how Hanami implements them. I find interactors to be a great way to organize such code.
ilya-jetruby
@ilya-jetruby

Actually the team is working hard on v2

Sure! But why it's like invisible for the others?
https://github.com/hanami/hanami/releases/tag/v2.0.0.alpha1
30 Jan 2019

Yuriy Tsemashko
@azzz
@sebastjan-hribar thanks, I didn't find the interactors before.
Armin
@wuarmin
Brett Dudo
@dudo
image.png
when using "actions" with hanami-api, the self.body= setter doesn't seem to work. This works. Feels like I'm not doing something correctly, though
also, I couldn't get validations to work. is the dot syntax correct, or the block syntax? there's competing docs
Brett Dudo
@dudo
image.png
if anyone finds this... I ended up just keeping things in config.ru, and it's pretty clean with the serializers
kelvin romero
@_kelvinromero_twitter
Hello everyone. Any of you happen to use some health check gem for Hanami?
Sebastjan Hribar
@sebastjan-hribar
I've recently asked about getting the controller for each action. I need to get controller name, like Task. I couldn't find any other way but to pars Web::Controllers::Task::New for example. Is there a better way?
Edouard
@inouire_twitter
by action you mean route ?
Sebastjan Hribar
@sebastjan-hribar
I mean I currently deal with what is listed under Action if I run hanami routes: Web::Controllers::Users::Index. In this particular case I'd grab Usersand use singular form and Index.
Robert
@hedselu

HI, I noticed a problem during migration execution, basically I've got migration like this:

Hanami::Model.migration do
  change do
    create_table :users do
      primary_key :id

      column :email,              String, null: false
      column :encrypted_password, String
      column :phone_number,       String

      column :created_at, DateTime, null: false
      column :updated_at, DateTime, null: false
    end
  end
end

When I run it, it shows me following snippet

[hanami] [ERROR] PG::UndefinedTable: ERROR:  relation "schema_migrations" does not exist
LINE 1: SELECT NULL AS "nil" FROM "schema_migrations" LIMIT 1
                                  ^: SELECT NULL AS "nil" FROM "schema_migrations" LIMIT 1
[hanami] [INFO] (0.042149s) CREATE TABLE "schema_migrations" ("filename" text PRIMARY KEY)
[hanami] [ERROR] PG::UndefinedTable: ERROR:  relation "schema_info" does not exist
LINE 1: SELECT NULL AS "nil" FROM "schema_info" LIMIT 1
                                  ^: SELECT NULL AS "nil" FROM "schema_info" LIMIT 1

But, when I add null: true to encrypted_password and phone_number everything works smoothly. Both in hanami guide and in rom-sql I see this is an optional attribute. Anyone has idea what can cause this issue?

Edouard
@inouire_twitter
The 2 problem seem pretty unrelated, so I'd guess there is a typo somewhere
do you have other migration files ?
are you sure there isn't an invisble char (like unbreakble space) that messes up with the migration content ?
Kai Kuchenbecker
@kaikuchn
There isn't any actual problem in the provided log output
What's happening is that when migrations run the migrator first checks whether the required tables schema_migrations and schema_info exist, if they don't they are created.
Sadly this step is rather verbose and outputs this non-error as if it were an error... but it's how the underlying gem handles it and we cannot do much about it.
Robert
@hedselu

Hi, thank you @inouire_twitter and @kaikuchn for responding me. I'll verify if there is no invisible char when in the evening. Also, this is the only migration I have.

About the errors and checks - what I see is in related database schema_migrartions table is being created but no schema_info is present. Also, running hanami db prepare once again, on already migrated database, the output of execution remains the same.

Noman Ur Rehman
@nomanurrehman
Are there documented problems with Hanami inside a container?