Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Unit alias 'pt' ambiguous #35

Closed
jsteinberg opened this Issue · 0 comments

2 participants

@jsteinberg

In the unit_definitions / standard.rb file 'pt' is used as an alias twice.

Unit.define('pint') do |pint|
pint.definition = Unit('1/8 gal')
pint.aliases = %w{pt pint pints}
end

Unit.define('point') do |point|
point.definition = Unit('1/72 ft')
point.aliases = %w{pt point points}
end

I believe the pint is created first and the point unit overrides it's 'pt' alias in the base_unit_cache. In my project I was using pints as pt, and now that is broken. I have fixed it with an initializer in my project, but I feel like one of these should be removed.

I could submit a trivial pull request fixing it one way or another, but as the gem author it is probably your call on which one to keep.

@olbrich olbrich closed this in 8a103e4
@rage-shadowman rage-shadowman referenced this issue in gentooboontoo/js-quantities
Open

"pt" is an alias for both "point" and "pint" #26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.