Giter Club home page Giter Club logo

croods-rails's People

Contributors

alanmaik avatar andrepinho avatar danielweinmann avatar dependabot[bot] avatar felipefreitag avatar gustavoguichard avatar keernel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

diegotoral

croods-rails's Issues

Basic Authorization documentation

Croods does a lot of authorization by default, we need to make that explicit in Readme.

I'm registering this issue after trying - and failing - to better explain what user_is_not_the_owner? does to @giovanisleite.

Have an easy way to return a resource that belongs to current_user

It's very common to need to return either a resource or list of resources that belong to curret_user, like:
current_user.offers.order(created_at: desc).first
current_user.saved_companies
current_user.reviews
These endpoints don't require an user_id since we're using the session to identify the owner.
We could apply this pattern to index, show, create and update endpoints, at least.

Do not consider optional belongs_to associations when searching for an owner

Found on TCC:

  • message belongs_to offers_diamond, optional: true
  • message belongs_to offer

Resulting SQL for #index:
"SELECT "messages".* FROM "messages" INNER JOIN "offers_diamonds" ON "offers_diamonds"."id" = "messages"."offers_diamond_id" INNER JOIN "offers" ON "offers"."id" = "offers_diamonds"."offer_id" WHERE "offers"."user_id" = 48 AND "messages"."offer_id" = 41 ORDER BY "messages"."created_at" DESC"

Add a resource generator

add resource generator that with a command generates necessary files and folders for the resource something like the Rails generator: rails g ***

Rails 6?

Our new-rails-api and all our projects still uses Rails 5.
Will this gem be compatible?

Are the usual gems - devise, etc - already prepared to work with Rails 6?

When adding an attribute in the request that does not exist in the resource

When using an updated endpoint sending only a custom example of an attribute: Resource Offer with name and status.
I add an attribute to the request:

request do
  add_attribute :change_status, :string, null: true
end

If only change_status is sent in the request I get the error below:

Failure/Error: super(*json_args(*args))
     
     ActionController::ParameterMissing:
       param is missing or the value is empty: offer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.