Module: Housekeeping

Defined Under Namespace

Modules: AssociationHelpers, CombinedScopes, Projects, Timestamps, Users

Instance Method Summary collapse

Instance Method Details

#has_polymorphic_relationship?Boolean


13
14
15
# File 'lib/housekeeping.rb', line 13

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