Class: FmRest::Spyke::Portal
- Inherits:
-
Spyke::Associations::HasMany
- Object
- Spyke::Associations::HasMany
- FmRest::Spyke::Portal
- Defined in:
- lib/fmrest/spyke/portal.rb
Overview
Extend Spyke's HasMany association with custom options
Instance Method Summary collapse
- #attribute_prefix ⇒ Object
-
#initialize(*args) ⇒ Portal
constructor
A new instance of Portal.
- #parent_changes_applied ⇒ Object
- #portal_key ⇒ Object
Constructor Details
#initialize(*args) ⇒ Portal
Returns a new instance of Portal.
8 9 10 11 12 13 |
# File 'lib/fmrest/spyke/portal.rb', line 8 def initialize(*args) super # Portals are always embedded, so no special URI [:uri] = "" end |
Instance Method Details
#attribute_prefix ⇒ Object
20 21 22 |
# File 'lib/fmrest/spyke/portal.rb', line 20 def attribute_prefix [:attribute_prefix] || portal_key end |
#parent_changes_applied ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/fmrest/spyke/portal.rb', line 24 def parent_changes_applied each do |record| record.changes_applied # Saving portal data doesn't provide new modIds for the # portal records, so we clear them instead. We can still save # portal data without a mod_id (it's optional in FM Data API) record.mod_id = nil end end |
#portal_key ⇒ Object
15 16 17 18 |
# File 'lib/fmrest/spyke/portal.rb', line 15 def portal_key return [:portal_key] if [:portal_key] name end |