kaspernj / api_maker Goto Github PK
View Code? Open in Web Editor NEWA Rails gem for generating a JavaScript API automatically based on your ActiveRecord models.
A Rails gem for generating a JavaScript API automatically based on your ActiveRecord models.
Since that is built in and used by API maker.
There are more names that shouldn't be allowed so make support for that as well.
It doesn't add a lot of value to have the generated javascript models in version control.
Also, it would be nice to not have to run rails api_maker:generate_models
every time a resource is changed.
So, it would be a great improvement, if they could be generated dynamically in development/test.
Then for production, as part of the build, you could run the api_maker:generate_models
task.
If a Date- or Time attribute is returned in a resource, it will be read as a Date in JavaScript, because API maker knows the type of the attribute.
If you delegate or otherwise return a custom attribute (where the type is unknown), a Date or Time will be returned as a string.
It should be returned in Ruby as JSON as {type: :date, date: actual_date}
or {type: :time, time: actual_time}
and then automatically be converted to a Date in JS on the other side.
One for each: BelongsTo, HasMany and HasOne
Collection should use preloaded result from original model, if no other arguments has been given to the query.
If somebody send 1'000 commands and all are getting executed at the same time with_thread
the server load can become huge.
Dependabot couldn't find a Gemfile for this project.
Dependabot requires a Gemfile to evaluate your project's current Ruby dependencies. It had expected to find one at the path: /Gemfile
.
If this isn't a Ruby project, or if it is a library, you may wish to disable updates for it from within Dependabot.
import {User} from "api-maker/models"
await canCan.loadAbility("read", User)
if (canCan.can("read", User)) {
console.log("Can read users")
}
when saving array of hashes on nested_attributes (one-to-many) it returns error
undefined method `keys' for #<Array:0x00007f9959d4f838>
.../api_maker-396c2714060c/app/services/api_maker/validation_errors_generator_service.rb:71:in `check_nested_many_models_for_validation_errors'
.../api_maker-396c2714060c/app/services/api_maker/validation_errors_generator_service.rb:55:in `block in inspect_params'
The current Array of attributes
is fine if you only need to iterate through them all.
But I would like to look up the type
of one attribute.
Having the attributes
as either an Object or Map would be good for both those use cases.
Looks like will_paginate
has become a mandatory dependency
This should provide better performance and reduce log output by a lot.
I get this error, when running the spec.
Seems to be due to my machine running a different timezone than the CI.
1) bootstrap - string input renders a datetime local field as sets the value correctly
Failure/Error: expect(input[:value]).to eq "1985-06-17T10:30:00"
expected: "1985-06-17T10:30:00"
got: "1985-06-17T12:30:00"
(compared using ==)
# ./spec/system/bootstrap/string_input_spec.rb:28:in `block (2 levels) in <main>'
Add spec that ensures model names like Ahoy::Message works. This was fixed by using collection keys instead of plural names earlier.
Extract Rails inspection data of validators to the client and let the client perform validation client side to save server side resources and make isValid
work.
From README.md
gem "api_maker"
It doesn't work because the gem isn't on rubygems.org.
Could you please create the gem on rubygems.org?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.