Where is “megabytes” method for fixnums defined? As far as I understand, its not a core ruby method, since its only available in rails.
ruby -e 'puts 5.megabytes'
In default rails installation it returns:
Loading development environment (Rails 2.3.8)
>> 5.megabytes
=> 5242880
At some point in my app something wrong happen, and now megabytes returns wrong values…
Loading development environment (Rails 2.3.8)
>> 5_000_000
=> 5000000
>> 5.megabytes
=> 5120
>> 5.kilobytes
=> 5
>> 5.bytes
=> 5
I am guessing some gem did something very wrong, but Its hard for me to track it to the source now.
Any idea how to find out where is the problem located?
Problem was in god gem, which was overwriting those methods in Numeric for unknown reason. This could easily break the app totaly, since I have lots of validations based on those methods. run
There is no need in general to include god in the app itself, but some people might in order to automate deployment…
I read some info about the gem, and people generally suggest it is quite broken in general due to lots of memory leaks. Any suggestions about this?