LoginSignup
2
2

More than 5 years have passed since last update.

godとRailsを合わせて使うとNumeric#daysやNumeric#kilobytesなどが上書きされる

Last updated at Posted at 2012-11-27

環境

god v0.12.1
Rails v3.2.6

状況

godのsuger.rbではNumericクラスにdayskilobytesといったメソッドを実装しているが,これがActiveSupportのcore_ext/numeric/time.rbbyte.rbと衝突して意図しない数値が返ってくる.

[1] pry(main)> DateTime.now                      
=> Mon, 23 Jul 2012 16:23:53 +0900
[2] pry(main)> DateTime.now.end_of_week
=> Tue, 22 Nov 3431 23:59:59 +0900

対処

https://github.com/mojombo/god/issues/61 によると"godとRails混ぜて使うな"とのこと.Gemfileに以下のように書いてauto loadを避ける

Gemfile
gem 'god', :require => false
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2