Module: PolymorphicModel::InstanceMethods

Defined in:
lib/polymorphic_model.rb

Instance Method Summary collapse

Instance Method Details

#valid_type?Boolean

Returns true if model instance is correct type

Returns:

  • (Boolean)


24
25
26
# File 'lib/polymorphic_model.rb', line 24

def valid_type?
  self.class.types.include?(send(self.class.polymorphic_column_name).to_sym)
end