It is known that in Ruby, class methods get inherited: class P def self.mm; puts 'abc' end end class Q < P; end Q.mm # works However, it comes as a surprise to me that it does not work with mixins: module M def self.mm; puts 'mixin' end end class N; include M end M.mm # works N.mm # does not work! I know that #extend method can do this: module X; def mm; puts 'extender' end end Y = Class.new.exten
I've got a project where there is a CURRENCY and COUNTRY table. There's a PRICE model that requires a valid currency and country code, so I have the following validation: validates :currency_code, :presence => true, :inclusion => { :in => Currency.all_codes } validates :country_code, :presence => true, :inclusion => { :in => Country.all_codes } The all_codes method returns an array of just the cur
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く