cjheath / activefacts-generators Goto Github PK
View Code? Open in Web Editor NEWCode generators for the ActiveFacts Fact Modeling suite, including the Constellation Query Language
License: MIT License
Code generators for the ActiveFacts Fact Modeling suite, including the Constellation Query Language
License: MIT License
When activerecord generator generates a has_many :through
relation it needs to supply :source
argument to state what is name of other side of relation
eg
has_many :people_with_read_grants, :through => :read_accesses_granted
needs to be
has_many :people_with_read_grants, :through => :read_accesses_granted, :source => :viewer
otherwise activerecord fails to build a query
Currently rails model generator will generate foreign key constrains for belongs to relations ( when required )
eg
belongs_to :person
validates :person_sid, presence: true
this does not work well with nested attributes in rails, because it needs to save models in different order to meet the validation constraint, the work around that worked for me, is to validate relation rather than foreign key like so
belongs_to :person
validates :person, presence: true
Also looking at the docs, you can pass required: true
to belongs_to
any thoughts ?
EDIT: explained why it doesn't work with nested attributes
I'm getting this error:
afgen --rails/models foo.cql
In foo.cql at line 10 ObjectType Bar unrecognised
It'd be handy to print in ./foo.cql:10 ObjectType Bar unrecognised
because quite a few editors support jumping to a line based on the 'file:line[:column]' syntax.
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.