Skip to content

Add approval callback function for Boxcars::ActiveRecord for changes to the data #25

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

Merged
merged 5 commits into from
Feb 24, 2023

Conversation

francis
Copy link
Contributor

@francis francis commented Feb 23, 2023

  • add approval callback function
  • clean up keyword key setting and related tests

puts code.colorize(:yellow)
if read_only?
wrap_in_transaction do
eval code
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that right now is the perfect time to make your own wrapper method for eval code which will check for dangerous code inside.

like

def evaluate_input(code)
   ... strip `code` from dangerous methods ...
  eval code
end

and use it all around, since you already started using it in many places and probably will be more

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point.

@francis francis merged commit 9ef5e27 into main Feb 24, 2023
@francis francis deleted the active-record-boxcar-approval branch March 2, 2023 18:02
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.

2 participants