Skip to content

Conversation

kbrock
Copy link
Member

@kbrock kbrock commented Sep 12, 2025

WIP: still have to convert across
WIP: need to verify this doesn't bloat memory too much due to class closure in the lambda

Fixes #203

===

Not thrilled that we are keeping the method closure from virtual_attribute. that has quite a bit of data in there and the lambda

@kbrock kbrock added the wip Work in progress label Sep 12, 2025
arel ||= virtual_delegate_arel(source, to_ref)
elsif block_given?
define_method(name) do
has_attribute?(name) ? self[name] : instance_eval(&block)
Copy link
Member Author

@kbrock kbrock Sep 26, 2025

Choose a reason for hiding this comment

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

this is so nice.

Before

We can do minimal common manipulations for sql in the TableProxy, but can't do any common manipulation for the ruby code.

After

Adding stuff to ruby like the has_attribute? pattern is a big win.
Besides cutting down on the noise, we often forget to add this block and forgetting it can cause problems at runtime.

@kbrock kbrock changed the title [WIP] Implement Condensed VA syntax [WIP] [POC] Implement Condensed VA syntax Sep 26, 2025
@kbrock kbrock added the enhancement New feature or request label Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wip Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support condensed virtual_attribute definitions
1 participant