aws / aws-sdk-ruby-record

Official repository for the aws-record gem, an abstraction for Amazon DynamoDB.
Apache License 2.0
318 stars 41 forks source link

fix(115): FrozenError on BuildableSearch #116

Closed jessedoyle closed 3 years ago

jessedoyle commented 3 years ago

Hello!

I noticed that building queries dynamically via #build_query will mutate the underlying query string passed in to the key_expr method when Aws::Record is creating the prepared statement.

When using the frozen_string_literal: true directive, this causes the following exception to be raised:

FrozenError (can't modify frozen String: ...)

This PR resolves the issue by modifying the private methods that create a prepared statement to return a new string instance rather than mutate the underlying string.

Issue #, if available:

resolves #115.

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

alextwoods commented 3 years ago

Thanks for submitting this! Overall the change looks reasonable, but it looks like our travis based CI test suite has stopped working. We're working on fixing that and should be able to review this week.

mullermp commented 3 years ago

I've migrated to GH actions. Can we force a rebuild somehow?

jessedoyle commented 3 years ago

@mullermp - I’ll rebase the upstream changes into the branch. That should trigger a rebuild!

jessedoyle commented 3 years ago

@mullermp - Rebased! Looks like GitHub Actions just needs approval to run.

mullermp commented 3 years ago

Thanks for your contribution. We will release this sometime this week.