salesking / json_schema_builder Goto Github PK
View Code? Open in Web Editor NEWBuild JSON Schema for ActiveRecord models
Build JSON Schema for ActiveRecord models
Hi and thanks for this gem
If I have a model
class Account < ActiveRecord::Base
include Avatarify
end
that includes a concern
module Meritify
extend ActiveSupport::Concern
included do
mount_uploader :avatar, AvatarUploader
end
def thumb_avatar_url
avatar.thumb.url
end
def normal_avatar_url
avatar.normal.url
end
end
and i run
SchemaBuilder::Writer.new.write
via rails console
I'm getting this
ActiveSupport::Concern::MultipleIncludedBlocks: Cannot define multiple 'included' blocks for a Concern
from /home/oivai/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.0/lib/active_support/concern.rb:126:in `included'
If I exclude concern from model, everything works just fine. Would you point me to the right direction? Is there a solution?
After a clean git clone
and bundle install
, running the following gives:
$ bundle exec ./bin/schema
You should include GLI::App instead
GLI.run no longer works for GLI-2, you must just call `run(ARGV)' instead
either fix your app, or use the latest GLI in the 1.x family
Manually installing gli
version 1.x, with gem install gli -v "~> 1"
fixes the issue. This should be put in the gemspec.
It would be cool if a json schema representation could be created on the fly for a certain model(eg as a view). I am experimenting with dynamic models and a noSQL backend.
Do you know of a gem that does that? otherwise I might fork this little project (unless you want a pull request for it)
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.