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

Make Faker::Number return integers and floats instead of strings #510

Merged
merged 1 commit into from Jan 27, 2019

Conversation

tejasbubane
Copy link
Contributor

@tejasbubane tejasbubane commented Feb 15, 2016

Fixes #237 #1651

I think Faker::Number should return integers and floats instead of strings.

@b264
Copy link
Contributor

b264 commented Feb 19, 2016

This would require a version increase to 2.x for breaking changes, I think

@tejasbubane
Copy link
Contributor Author

@b264 Yes these are breaking changes. Waiting for what @stympy has to say.

@stympy
Copy link
Contributor

stympy commented Feb 21, 2016

Yeah, I think a version bump is good idea. I'll make that happen when I merge this.

@ivanovaleksey
Copy link

Hi guys.
@tejasbubane can you do rebase?

@tejasbubane
Copy link
Contributor Author

@ivanovaleksey Rebased

@ivanovaleksey
Copy link

Thank you @tejasbubane. I think now it can be merged?

@stympy
Copy link
Contributor

stympy commented Dec 26, 2016

Agreed on putting this in 2.0.

@stympy stympy added this to the 2.0 milestone Dec 26, 2016
@johannesluedke
Copy link

@stympy Will it be merged? Maybe this could also go into 1.9?

@tejasbubane
Copy link
Contributor Author

@vbrazo I have rebased the PR and fixed merge conflicts.

@vbrazo vbrazo mentioned this pull request Sep 4, 2018
@gkunwar
Copy link
Contributor

gkunwar commented Oct 29, 2018

@vbrazo is anyone is working on this PR, seems there is conflict in this PR.

@vbrazo vbrazo changed the base branch from master to v2 November 21, 2018 01:41
@vbrazo
Copy link
Member

vbrazo commented Dec 3, 2018

@gkunwar yes @tejasbubane is on it. I think we could create a Book namespace, wrap a few faker objects in this namespace and deprecate the old ones. Feel free to work on this task.

@tejasbubane could you rebase with v2 branch?

@tejasbubane tejasbubane force-pushed the number-values-not-strings branch 3 times, most recently from 776a284 to 0e062f6 Compare January 23, 2019 13:19
* Change `Number.number` to return integers.
* Remove `leading_zero_number` because it has no meaning now that we are
  returning integers.
* Remove `decimal_part` because it can now be replaced by `number`.
* Fix all failing tests
@tejasbubane
Copy link
Contributor Author

@vbrazo I have rebased on v2 branch.


# Required parameter: digits
# Produces a number of the specified digits with a leading zero
Faker::Number.leading_zero_number(10) #=> "0669336915"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have removed leading_zero_number because it has no meaning now that we are returning integers.


# Required parameter: digits
# Produces a 2-digit number, preserves leading 0's
Faker::Number.decimal_part(2) #=> "09"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed decimal_part because it can now be replaced by number/number.to_s as required.

@vbrazo
Copy link
Member

vbrazo commented Jan 23, 2019

if you want to remove the methods, you need to deprecate them first.

@tejasbubane
Copy link
Contributor Author

@vbrazo This PR is against v2 branch. Can we deprecate the methods in master and then remove from v2? Or do you want me deprecate in this PR?

@vbrazo
Copy link
Member

vbrazo commented Jan 27, 2019

Please open a new PR and deprecate the leading_zero_number and decimal_part @tejasbubane

@vbrazo vbrazo merged commit 60fd3c9 into faker-ruby:v2 Jan 27, 2019
@vbrazo
Copy link
Member

vbrazo commented Jan 27, 2019

@tejasbubane #1516

@tejasbubane tejasbubane deleted the number-values-not-strings branch January 27, 2019 18:18
@vbrazo vbrazo mentioned this pull request Jul 24, 2019
@mashedkeyboard
Copy link
Contributor

Hi, despite this being recognised as a breaking change, it wasn't included in the main breaking changes list for the v2 release. Could this be fixed, just to save some other devs like me headache in the future?

michebble pushed a commit to michebble/faker that referenced this pull request Feb 16, 2020
…er-ruby#510)

* Change `Number.number` to return integers.
* Remove `leading_zero_number` because it has no meaning now that we are
  returning integers.
* Remove `decimal_part` because it can now be replaced by `number`.
* Fix all failing tests
davidmorton0 pushed a commit to davidmorton0/faker that referenced this pull request Jul 12, 2021
…er-ruby#510)

* Change `Number.number` to return integers.
* Remove `leading_zero_number` because it has no meaning now that we are
  returning integers.
* Remove `decimal_part` because it can now be replaced by `number`.
* Fix all failing tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants