Arnold Roa Arnold Roa - 25 days ago 7
Ruby Question

condition on model on class macros

It's possible to put conditions on models like:

class MyPeppers < ActiveRecord::Base
acts_as_a_ferret() if Rails.env.production?
end


It's valid ruby code but I wonder if that should work?

Answer

Yes, it will work because it is a perfectly valid Ruby code.