card 1.17.0 → 1.17.1

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: 2b598a640ef114a0aa9f6333233a40327ba8be8a
4
- data.tar.gz: ee0435e5572b9452ba47191d7372b40586a65c65
3
+ metadata.gz: a4f48d47748a3722b990ce46cf124c029ab739c0
4
+ data.tar.gz: e75894912cdeedb1503358bcf5debe5c85bb3019
5
5
  SHA512:
6
- metadata.gz: bf919458360717f7c3177a8a3f17925cfe48c2cd5834934f87b9929371ec6b28293a228619cb3e69c5242396b338e67c2fdfa8b3f8500c6c7108344858337487
7
- data.tar.gz: feac07b98bcc01bb58b24c44f31699999e66f5c7742c1c65af0c0b632c92f4fcfa05abca048878dc5514e286e57d1c507cc24d22a692481a70b3777d2902cf68
6
+ metadata.gz: d70cba85ffa764ea15973673238a89d8d19afcd50b2ec46d3eacf13e71ae617def616d83a044bf6150f1d636fd496c0061127cb708bbe87125957d676a12fcba
7
+ data.tar.gz: 5b0d8f08cc4dfee2cf0e28ad804e9f61b6c3365041421be40b582506300177a6abf29845b61f834a76345b7a7cc943abdb0b84f9b0d26f47f5150b3e1c95e77e
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.17.0
1
+ 1.17.1
data/lib/card/cache.rb CHANGED
@@ -22,7 +22,7 @@ class Card
22
22
 
23
23
  class << self
24
24
  def [] klass
25
- raise 'nil klass' if klass.nil?
25
+ fail 'nil klass' if klass.nil?
26
26
  cache_type = (@@no_rails_cache ? nil : Cardio.cache)
27
27
  cache_by_class[klass] ||= new class: klass,
28
28
  store: cache_type
@@ -30,17 +30,20 @@ class Card
30
30
 
31
31
  def renew
32
32
  cache_by_class.keys do |klass|
33
- if klass.cache
34
- cache_by_class[klass].system_prefix = system_prefix(klass)
35
- else
36
- raise "renewing nil cache: #{klass}"
37
- end
33
+ fail "renewing nil cache: #{klass}" unless klass.cache
34
+ cache_by_class[klass].system_prefix = system_prefix(klass)
38
35
  end
39
36
  reset_soft
40
37
  end
41
38
 
39
+ def database_name
40
+ @database_name ||= (cfg = Cardio.config) &&
41
+ (dbcfg = cfg.database_configuration) &&
42
+ dbcfg[Rails.env]['database']
43
+ end
44
+
42
45
  def system_prefix klass
43
- "#{Rails.env}/#{klass}"
46
+ "#{database_name}/#{klass}"
44
47
  end
45
48
 
46
49
  def restore
@@ -51,7 +51,7 @@ class Card::Reference < ActiveRecord::Base
51
51
  joins(
52
52
  'LEFT JOIN cards ON card_references.referer_id = cards.id'
53
53
  ).where(
54
- 'cards.id IS NULL OR cards.trash IS TRUE'
54
+ 'cards.id IS NULL'
55
55
  ).delete_all
56
56
  end
57
57
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.17.0
4
+ version: 1.17.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2016-01-22 00:00:00.000000000 Z
14
+ date: 2016-01-28 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: smartname