Module: Housekeeping

Overview

Concerns for models that have creator/updaters.

Defined Under Namespace

Modules: Projects, Users

Instance Method Summary collapse

Instance Method Details

#has_polymorphic_relationship?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/housekeeping.rb', line 9

def has_polymorphic_relationship?
  self.class.reflect_on_all_associations(:belongs_to).select{|a| a.polymorphic?}.count > 0
end