Class: Exwiw::BelongsTo

Inherits:
Object
  • Object
show all
Includes:
Serdes
Defined in:
lib/exwiw/belongs_to.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_symbol_keys(hash) ⇒ Object



15
16
17
# File 'lib/exwiw/belongs_to.rb', line 15

def self.from_symbol_keys(hash)
  from(hash.transform_keys(&:to_s))
end

Instance Method Details

#polymorphic?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/exwiw/belongs_to.rb', line 19

def polymorphic?
  !foreign_type.nil?
end

#to_hashObject



23
24
25
# File 'lib/exwiw/belongs_to.rb', line 23

def to_hash
  super.compact
end