Module: Housekeeping

Defined Under Namespace

Modules: CombinedScopes, Projects, Timestamps, Users

Instance Method Summary collapse

Instance Method Details

#has_polymorphic_relationship?Boolean

TODO: method belongs in ApplicationEnumeration

Returns:

  • (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