Class: Developer

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/developer.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.id_cacheObject



9
10
11
# File 'app/models/developer.rb', line 9

def self.id_cache
  @id_cache ||= DistributedCache.new("developer_ids")
end

.rebuild_cacheObject



17
18
19
# File 'app/models/developer.rb', line 17

def self.rebuild_cache
  id_cache.clear
end

.user_idsObject



13
14
15
# File 'app/models/developer.rb', line 13

def self.user_ids
  id_cache.defer_get_set("ids") { Set.new(Developer.pluck(:user_id)) }
end

Instance Method Details

#rebuild_cacheObject



21
22
23
# File 'app/models/developer.rb', line 21

def rebuild_cache
  Developer.rebuild_cache
end