Skip to content

Commit

Permalink
Fix predicate name style per Rubocop
Browse files Browse the repository at this point in the history
lib/active_model/serializer/adapter/cache_check.rb:28:13: C: Style/PredicateName: Rename is_cached? to cached?. (https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark)
        def is_cached?
            ^^^^^^^^^^
lib/active_model/serializer/adapter/cache_check.rb:32:13: C: Style/PredicateName: Rename is_fragment_cached? to fragment_cached?. (https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark)
        def is_fragment_cached?
            ^^^^^^^^^^^^^^^^^^^
  • Loading branch information
bf4 committed Sep 13, 2015
1 parent b7ef2ec commit c4bc8a1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/active_model/serializer/adapter/cache_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ module CacheCheck
def cache_check(serializer)
@cached_serializer = serializer
@klass = @cached_serializer.class
if is_cached?
if cached?
@klass._cache.fetch(cache_key, @klass._cache_options) do
yield
end
elsif is_fragment_cached?
elsif fragment_cached?
FragmentCache.new(self, @cached_serializer, options).fetch
else
yield
Expand All @@ -25,11 +25,11 @@ def cache_key

private

def is_cached?
def cached?
@klass._cache && !@klass._cache_only && !@klass._cache_except
end

def is_fragment_cached?
def fragment_cached?
@klass._cache_only && !@klass._cache_except || !@klass._cache_only && @klass._cache_except
end

Expand Down

0 comments on commit c4bc8a1

Please sign in to comment.