Sha256: cf6694f022de7175e2640e5df5474e1ab1d7fc17b3482454887c331edf085710
Contents?: true
Size: 696 Bytes
Versions: 9
Compression:
Stored size: 696 Bytes
Contents
require 'spec_helper' describe Socialization::ActiveRecordStores::Mixins::Base do describe ".update_counter" do it "increments counter cache if column exists" do followable = ImAFollowableWithCounterCache.create update_counter(followable, followers_count: +1) expect(followable.reload.followers_count).to eq(1) end it "does not raise any errors if column doesn't exist" do followable = ImAFollowable.create update_counter(followable, followers_count: +1) end end def update_counter(model, counter) klass = Object.new klass.extend(Socialization::ActiveRecordStores::Mixins::Base) klass.update_counter(model, counter) end end
Version data entries
9 entries across 9 versions & 2 rubygems