Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Computed fields #2

Merged
merged 27 commits into from
Nov 9, 2020
Merged

Computed fields #2

merged 27 commits into from
Nov 9, 2020

Conversation

diegosenarruzza
Copy link
Collaborator

  • Add computed fields in nql syntax and collection syntax. Is an option to can have custom method for resolution in nql. Use the same gramatic to comapre like a simple attribute.

  • Unify the term Field as Attribute, have no inconsistencies or ambiguities.

  • Computed attributes are saved in a hash on collection, and use a object like a wrapper to save it, called ComputedAttribute.

  • Add a method in query to can append that computed field, this method realice the join if is necesary,

rule field
_tables:(table:field_name '.')* _column:field_name <Nodes::Field>
rule computed_attribute
name:basic '()' <Nodes::ComputedAttribute>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No debería ir attribute_name en lugar de basic?

spec/computed_attribute_spec.rb Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Nov 3, 2020

Coverage Status

Coverage remained the same at 100.0% when pulling 8bdd5b8 on computed_fields into fd764fb on master.

Rename method
@gabynaiman gabynaiman merged commit df35929 into master Nov 9, 2020
@gabynaiman gabynaiman deleted the computed_fields branch December 1, 2020 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants