ruby-on-railsrubyacts-as-ferret

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?


Solution

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