Class: Exwiw::BelongsTo
- Inherits:
-
Object
- Object
- Exwiw::BelongsTo
- 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
16 17 18 |
# File 'lib/exwiw/belongs_to.rb', line 16 def self.from_symbol_keys(hash) from(hash.transform_keys(&:to_s)) end |
Instance Method Details
#polymorphic? ⇒ Boolean
20 21 22 |
# File 'lib/exwiw/belongs_to.rb', line 20 def polymorphic? !foreign_type.nil? end |
#to_hash ⇒ Object
24 25 26 |
# File 'lib/exwiw/belongs_to.rb', line 24 def to_hash super.compact end |