synchronisable 1.2.5 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aa82239a1d8afe52781e0d25083bb8071f5d759c
4
- data.tar.gz: 5ba879e3309b67c3871e049c78e355d7ebf6461b
3
+ metadata.gz: e8dcb213c47fd20de3a67b8872e96e33a09d5804
4
+ data.tar.gz: d5f807dc6ef313e746cf8d9e2c3f842de9a7f3da
5
5
  SHA512:
6
- metadata.gz: 33c2d51feed05c9c2c39127a61ef572b079a80a054594f8dd074bbf3d71e1c7e0a1c7887f387fbb5803985f5684ba69d5eaaef4dfcbbcdaf5a1322a1d36b3970
7
- data.tar.gz: 5d7456b69a62988c315728a164f93214c4e26add827905c841499c9f9851a48f6fb58e079a2bf306e472964d496da38cc6d0a5c301cbc6766b935f5765c11536
6
+ metadata.gz: 610b96516fa42f8aa3f242b863571a5c3173284a00a192d06ea4f295cc84ebe405d57ad107192f9f700a27a532d76c0871facc871e0b69d0e9dc2bf94a1d99b7
7
+ data.tar.gz: 813a3982528b29b77ed50d13d49d5cfbefc75bac6bf2047cc9703e9d33cbee2f70725772585da0df6d588b45e974448a60cc992692687083eb6085f8dcba3536
@@ -59,8 +59,12 @@ module Synchronisable
59
59
  end
60
60
 
61
61
  def self.find_models
62
+ # Need to preload models first
63
+ Rails.application.eager_load!
64
+
62
65
  ActiveRecord::Base.descendants.select do |model|
63
- model.included_modules.include?(Synchronisable::Model)
66
+ model.included_modules.include?(Synchronisable::Model) &&
67
+ model.synchronisable?
64
68
  end
65
69
  end
66
70
  end
@@ -45,6 +45,10 @@ module Synchronisable
45
45
  dependent: options[:dependent]
46
46
  end
47
47
 
48
+ def synchronisable?
49
+ false
50
+ end
51
+
48
52
  private
49
53
 
50
54
  def set_defaults(options)
@@ -5,6 +5,10 @@ module Synchronisable
5
5
  module Model
6
6
  # Methods that will be attached to synchronisable model class.
7
7
  module Methods
8
+ def synchronisable?
9
+ true
10
+ end
11
+
8
12
  # Creates a new controller, that initiates synchronization
9
13
  # for this particular model and its associations.
10
14
  # If you have implemented `fetch` & `find` methods
@@ -2,7 +2,7 @@ module Synchronisable
2
2
  module VERSION
3
3
  MAJOR = 1
4
4
  MINOR = 2
5
- PATCH = 5
5
+ PATCH = 6
6
6
  SUFFIX = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, SUFFIX].compact.join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: synchronisable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.5
4
+ version: 1.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vasiliy Yorkin