GithubHelp home page GithubHelp logo

cjheath / activefacts-generators Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 2.0 98 KB

Code generators for the ActiveFacts Fact Modeling suite, including the Constellation Query Language

License: MIT License

Ruby 99.16% CSS 0.84%

activefacts-generators's People

Contributors

cjheath avatar dougma avatar

Watchers

 avatar  avatar  avatar

Forkers

graemeport dougma

activefacts-generators's Issues

Error formatting

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.

rails/models: Relation constrains vs Foreign key constraint

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

Relations generation is missing source

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

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.