Module: Synchronisable::Model::Methods
- Defined in:
- lib/synchronisable/model/methods.rb
Overview
Methods that will be attached to synchronisable model class.
Instance Method Summary collapse
-
#imports_count ⇒ Object
Count of import records for this model.
-
#sync(*args) ⇒ Object
Creates a new controller, that initiates synchronization for this particular model and its associations.
- #synchronisable? ⇒ Boolean
Instance Method Details
#imports_count ⇒ Object
Count of import records for this model.
63 64 65 |
# File 'lib/synchronisable/model/methods.rb', line 63 def imports_count Import.where(synchronisable_type: self).count end |
#sync(data, options) ⇒ Object #sync(options) ⇒ Object #sync(data) ⇒ Object #sync ⇒ Object
Creates a new controller, that initiates synchronization for this particular model and its associations. If you have implemented ‘fetch` & `find` methods in your model synchronizer, than it will be used if no data supplied.
58 59 60 |
# File 'lib/synchronisable/model/methods.rb', line 58 def sync(*args) Controller.call(self, *args) end |
#synchronisable? ⇒ Boolean
8 9 10 |
# File 'lib/synchronisable/model/methods.rb', line 8 def synchronisable? true end |