permanent_records 4.1.6 → 4.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ea46f013888d1a6a86b72d48dc0695d6e8c001aa
4
- data.tar.gz: d881533bfce2762905a83a6ad2255333cae14197
3
+ metadata.gz: 20dcb9aa315fd6a5ef68fe0085e48ae281302553
4
+ data.tar.gz: 630fbfcca7864a15dd4153a5ae43e5f608f8113b
5
5
  SHA512:
6
- metadata.gz: 179fa785989872e008a059d1d1fcbc00b3aa1dbb04039f1a79a9900b048fc21f9ac790e21880a9e96d3da6ef7c279cfe8305da30086bf4bc2bb62177d2687e23
7
- data.tar.gz: a4d4bf79adb1284f10ad2229dfb3edd54ec318a6ca9fa858d68a46df57f92f24617393105bfea710b9238f667afee62b4eb2ded835053180fac6b09dfd83114f
6
+ metadata.gz: d82a489616bb8429db6850d05108a4f5af30ac2cef7f1971d10340d36b361d859fd59e51d02aaccddda3e44670c327d960d907e6645e790ef2c617e424ab0c01
7
+ data.tar.gz: bca5df4208d994416d08df2fda5911761eb72953e39e3e385d30e17a50c593ed59e2451c90c7666c213493e583cc936ab61b91580411c10f9da1d9e1b8a27469
data/.gitignore CHANGED
@@ -1,6 +1,6 @@
1
1
  spec/support/debug.log
2
2
  Gemfile.lock
3
3
  pkg
4
-
4
+ permanent_records*.gem
5
5
  *.swp
6
6
  .bundle
data/Rakefile CHANGED
@@ -3,6 +3,7 @@ require 'yaml'
3
3
  require 'English'
4
4
  Bundler::GemHelper.install_tasks
5
5
 
6
+ version = File.read('./VERSION').chomp
6
7
  CONFIG = YAML.load_file(
7
8
  File.expand_path('spec/support/database.yml', File.dirname(__FILE__))
8
9
  )
@@ -32,4 +33,13 @@ RSpec::Core::RakeTask.new(:rspec) do |t|
32
33
  t.rspec_opts = '-f d -c'
33
34
  end
34
35
 
36
+ task :publish do
37
+ # Ensure the gem builds
38
+ system('gem build permanent_records.gemspec') &&
39
+ # And we didn't leave anything (aside from the gem) uncommitted
40
+ !system('git status -s | egrep -v .') &&
41
+ system('git push') &&
42
+ system("gem push permanent_records-#{version}.gem")
43
+ end
44
+
35
45
  task default: [:rspec, :rubocop]
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.1.6
1
+ 4.1.7
@@ -107,8 +107,12 @@ module PermanentRecords
107
107
 
108
108
  def each_counter_cache
109
109
  _reflections.each do |name, reflection|
110
- associated_class = association(name).reflection.class_name.constantize
110
+ association = send(name.to_sym)
111
+ next if association.nil?
111
112
  next unless reflection.belongs_to? && reflection.counter_cache_column
113
+
114
+ associated_class = association.class
115
+
112
116
  yield(associated_class,
113
117
  reflection.counter_cache_column,
114
118
  send(reflection.foreign_key))
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: permanent_records
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.6
4
+ version: 4.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Danger Canty
@@ -16,7 +16,7 @@ authors:
16
16
  autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2016-06-06 00:00:00.000000000 Z
19
+ date: 2016-07-07 00:00:00.000000000 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: activerecord