Skip to content

Account for object default values when annotating models #1042

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

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add test
  • Loading branch information
mochetts committed May 7, 2025
commit 7edb9ab282a52e2c84688333d0a9de89dcf7221c
14 changes: 14 additions & 0 deletions spec/lib/annotate/annotate_models_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,20 @@ def mock_column(name, type, options = {})
is_expected.to eq(['1.2'])
end
end

context 'when the argument is an object that responds to to_s' do
let(:value) do
obj = Object.new
def obj.to_s
"custom string representation"
end
obj
end

it 'returns the result of to_s wrapped in quotes' do
is_expected.to eq('"custom string representation"')
end
end
end

describe '.parse_options' do
Expand Down
Loading