Eduard Garcia

Joined

2,960 Experience
21 Lessons Completed
1 Question Solved

Activity

Hi there,

I've got a Rails API that I would like to open to third parties. Basically I've got a platform where third parties can access it via API to retrieve a product list with name,category, stock, etc...

What I'm currently doing is creating a User and then asking them to first call the signin/login process and then using the JWT token to call the rest of the API.
What I would like to do is skip the signin process and generate a secure api token instead, send it to my third party for them to be passed as part of the header, kind of a permanent API token that could be used without expiry date.
Is there any gem or twisting the current strategies available, devise, jwt, etc...in order to achieve that?
Thanks!

Posted in Use Redis as a way to update a model along a process

Thanks Chris!
Your comment just confirmed my thoughts :-) yes was rather complex to deal with the serialized params stored in Redis. I could though do what you said of just storing just product id and quantity and eventually create the order in the database, that may work.
I guess that the next big step would be using Kafka topics for this kind of actions, but not much of these right now to think on implementing that.
Anyway a video using Kafka would be great :-D
Thanks again! good stuff!

Posted in Use Redis as a way to update a model along a process

Hi all!
I'm currently working on a purchase order process that has several steps before the final checkout, pretty standard, adding products in the basket their quantity and finally asking for the payment method and delivery address.

Currently this process it's been done updating the order at every step in the database, but taking into account that I'm already using Redis to cache the json responses, I was wondering if there is a way to store in Redis all this steps and just at the end, persist the order in the database.

I've seen some examples with to update counter values but nothing that can update an structure already stored in Redis and just update or merge it with new data.

Any advice on this would be appreciated.
Thanks!

Hi,
I'm trying to figure out a way to reduce the complexity of passing a JSON to a Vue.js component.
Currently I've got something like this placed on a model scope,

  scope :to_vue, -> (id) {where(team_id: id).order(position: :asc).to_json(
      only: [:id, :name, :position, :team_id], include: {
          postits: {
              include: [:user, comments: {
                  include: :actor
              }]
          }
      }
  )}

Anyone know a better way to create a Json format without all that amount of includes?

Thanks for your answers.

Posted in Vue.js Trello Clone in Rails - Part 8 Discussion

Really great stuff! going trhough the whole series it really helps to understand the power of vue as well as vuex and how both simplifies the way of dealing with data passing though components. Just want to go deeper into it now.