You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our app we create a sub class from Unit to apply some custom behaviour (#240 (comment)). This worked fine Ruby-Units 3.0 and before, but stopped working since Ruby-Units 4.0. If we try this now every .new call crashes with a undefined method keys' for nil:NilClass (NoMethodError)error inunit.rb:363:in unit_regex. This essentially breaks the functionality introduced in #241.
To reproduce:
Add Ruby-Units 4.0.x to the Gemfile, and execute the following:
class ChildUnit < Unit; end
ChildUnit.new('1 l')
We are suspecting this has something to do with the refactor in #274. Any suggestions on how to fix this would be welcome!
The text was updated successfully, but these errors were encountered:
@olbrich I tried it both in my sample project as well as in our real project and it both works great! Thanks for the quick fix!
We use a sub class of RubyUnits to override the eliminate_terms method with a simpler variant that does less simplification of the units after applying operations. E.g. when having Unit.new('10 l') / Unit.new('5 l') we leave this as 2 l/l instead of 2. See #240 for details.
In our app we create a sub class from Unit to apply some custom behaviour (#240 (comment)). This worked fine Ruby-Units 3.0 and before, but stopped working since Ruby-Units 4.0. If we try this now every .new call crashes with a
undefined method
keys' for nil:NilClass (NoMethodError)error in
unit.rb:363:inunit_regex
. This essentially breaks the functionality introduced in #241.To reproduce:
Add Ruby-Units 4.0.x to the Gemfile, and execute the following:
We are suspecting this has something to do with the refactor in #274. Any suggestions on how to fix this would be welcome!
The text was updated successfully, but these errors were encountered: