This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) Maxim Melentiev. | |
# This source code is licensed under the MIT license. | |
# | |
# Inspired by | |
# https://github.com/jeffreyguenther/vue-turbolinks/blob/master/index.js | |
# but changed to support going back to cached page with vue instance. | |
# Original version will keep instance created from cache along with new one. | |
plugin = | |
instances: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple policy implementation. Like a mixin of Pundit and CanCan. | |
module Policy | |
ACTIONS_MAP = { | |
index: :read, | |
show: :read, | |
new: :create, | |
edit: :update, | |
}.freeze | |
class Error < StandardError; end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RedisStats | |
attr_reader :redis, :pattern | |
def initialize(redis, pattern = '*') | |
@redis = redis | |
@pattern = pattern | |
end | |
def all_keys | |
@all_keys ||= [].tap do |result| |
OlderNewer