Module: Synchronisable::Model::ClassMethods
- Defined in:
- lib/synchronisable/model.rb
Constant Summary collapse
- SYNCHRONIZER_SUFFIX =
'Synchronizer'
Instance Method Summary collapse
-
#synchronisable(*args) ⇒ Object
Declare this on your model class to make it synchronisable.
- #synchronisable? ⇒ Boolean
Instance Method Details
#synchronisable(klass, options) ⇒ Object #synchronisable(options) ⇒ Object #synchronisable ⇒ Object
Declare this on your model class to make it synchronisable. After that you can call Methods#sync to start model synchronization.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/synchronisable/model.rb', line 31 def synchronisable(*args) extend Synchronisable::Model::Methods extend Synchronisable::Model::Scopes class_attribute :synchronizer = args. set_defaults() set_synchronizer(args, ) has_one :import, as: :synchronisable, class_name: 'Synchronisable::Import', dependent: [:dependent] end |
#synchronisable? ⇒ Boolean
48 49 50 |
# File 'lib/synchronisable/model.rb', line 48 def synchronisable? false end |