diff --git a/lib/active_record_shards/model.rb b/lib/active_record_shards/model.rb index 7d3c6581..d5e158c3 100644 --- a/lib/active_record_shards/model.rb +++ b/lib/active_record_shards/model.rb @@ -11,7 +11,8 @@ def not_sharded end def is_sharded? # rubocop:disable Naming/PredicateName - if self == ActiveRecord::Base + return self.sharded unless self.sharded.nil? + self.sharded = if self == ActiveRecord::Base sharded != false && supports_sharding? elsif self == base_class if sharded.nil?