Skip to content

Commit

Permalink
Add not_sharded back in with a deprecation warning.
Browse files Browse the repository at this point in the history
We are method chaining not_sharded in ZendeskDatabaseSupport and adding default
reading from the slave for unsharded models. To help the transition we'll keep
the not_sharded method around until we can remove it from the dependents.
  • Loading branch information
jacobat committed Oct 23, 2017
1 parent 9d1182c commit 529386f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/active_record_shards/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

module ActiveRecordShards
module Model
def not_sharded
ActiveSupport::Deprecation.warn("Calling not_sharded is deprecated. "\
"Please ensure to still read from the "\
"account db slave after removing the "\
"call.")
end

def is_sharded? # rubocop:disable Naming/PredicateName
self <= ActiveRecordShards::ShardedModel
end
Expand Down

0 comments on commit 529386f

Please sign in to comment.