snapbot 0.1.1 → 0.1.2

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
  SHA256:
3
- metadata.gz: aa9a6b0cbc5334ac7078254f385f9c859c0ea22d7ca4821741bade0b4c32cca6
4
- data.tar.gz: 8e69a33b99977466a92b9772abaa2e2d889a0d7ff200ed81c5effb01581eb014
3
+ metadata.gz: e57537e104190501dc2c47d19b8f76a95e91dd2b7f189f2686b4159c171ad101
4
+ data.tar.gz: d8dfe6118e506a0a10ad5d8dc86c8a8ba041e3fa99253d64c2a29062026f853f
5
5
  SHA512:
6
- metadata.gz: 1de519ae9f8e26a44d081682b83ca89d101daf00f5665c7d04a4ed1bb7c8ee701a72b476b45d9d5760ff2621e498d8bbe0ddfb3bde386fc4f188a16cee3c82db
7
- data.tar.gz: 6f549408fbffc23fc5f96f620dc0be49df614b84ce0e5c913fb375422bcec052f36e065a63080f03be3a2992c7f7a519873ab0efcb31bd9610e5b2f2bdf2340e
6
+ metadata.gz: 3c3d84a4445afa197bafa704cb1d2ac1535b8bdf12c8a19155734af415ca03aa9bc1fa2c28ba44903ddbcfd15fea0e1bcee244bdd0d99e4aaada3c6fbbcbb0c0
7
+ data.tar.gz: 3f19483aa69878acbdf035ef05d65be3db10f0d5f0bb4a79658020b86e6ed5580f2f366b4bb204fa312d99a7f197c021b1717852be828591f5fb74bb525a4a17
@@ -40,7 +40,7 @@ module Snapbot
40
40
  def collect_lets(example)
41
41
  @lets_by_value = RSpec::Lets.new(example).collect.each_with_object({}) do |sym, lets_by_value|
42
42
  value = example.send(sym) unless @ignore_lets.include?(sym)
43
- lets_by_value[value] = sym if value.is_a?(Reflector::BASE_ACTIVERECORD_CLASS)
43
+ lets_by_value[value] = sym if value.is_a?(reflector.base_activerecord_class)
44
44
  end
45
45
  end
46
46
 
@@ -5,12 +5,14 @@ require "active_record"
5
5
  module Snapbot
6
6
  # Reflect models and instances in a way that's useful for generating a diagram
7
7
  class Reflector
8
- BASE_ACTIVERECORD_CLASS = defined?(ApplicationRecord) ? ApplicationRecord : ActiveRecord::Base
8
+ def base_activerecord_class
9
+ defined?(ApplicationRecord) ? ApplicationRecord : ActiveRecord::Base
10
+ end
9
11
 
10
12
  def models(only_with_records: true)
11
13
  @models ||= begin
12
14
  Rails.application.eager_load! if defined?(Rails)
13
- BASE_ACTIVERECORD_CLASS.descendants.reject do |c|
15
+ base_activerecord_class.descendants.reject do |c|
14
16
  c.to_s == "Schema" || (only_with_records && c.count.zero?)
15
17
  end
16
18
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Snapbot
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snapbot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Russell Garner