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

allow false as default arg to html page #979

Merged
merged 1 commit into from
Nov 25, 2019

Conversation

bdtomlin
Copy link
Contributor

Purpose

Bug when using needs macro with boolean and false default value #978
Also added a few tests to keep things honest down the road.

Description

The source of the problem:

{% has_default = declaration.value || declaration.value == nil %}

This line accounts for nil, but not for false.

Checklist

  • - An issue already exists detailing the issue/or feature request that this PR fixes
  • - All specs are formatted with crystal tool format spec src
  • - Inline documentation has been added and/or updated
  • - Lucky builds on docker with ./script/setup
  • - All builds and specs pass on docker with ./script/test

Copy link
Member

@paulcsmith paulcsmith left a comment

Choose a reason for hiding this comment

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

Looks perfect! If you have time would you mind opening a PR for #804

It is along these same lines and would make it a lot nicer to use needs. But no pressure. I understand most of us are doing this in our free time :)

spec/lucky/html_page_spec.cr Show resolved Hide resolved
@paulcsmith paulcsmith merged commit d7f7db9 into luckyframework:master Nov 25, 2019
@bdtomlin
Copy link
Contributor Author

@paulcsmith I'll definitely take a look at #804, if not today, within the next day or so.

@paulcsmith
Copy link
Member

Awesome! Thanks @bdtomlin

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