qa 0.10.0 → 0.10.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: e5ce81b7b841779705a850c38259249eb3d87911
4
- data.tar.gz: 57de65366200cca987411cf3a0ee8fe9c65320b1
3
+ metadata.gz: 87d95a0b1bdcbe0f16ac1ab1a5df3c0f3f5c84d7
4
+ data.tar.gz: d05ff39f1e7cf5f3803d79c8633cae5269a8746f
5
5
  SHA512:
6
- metadata.gz: 4cba3e3e087eeaa9a5b754d53bfa55f6b89033b1b108ea750e999aec6b3c68fb7c4c1ac1a82024c6a77d1e1c5046ea57fc2f4bc818e7d386071d7480c5ba2e4a
7
- data.tar.gz: b5d1f9021e03bf74c8f7a9a576f95483fa212a51f70a13ac7666de3fb59f4ece0a5f9da57c93f533bbcff9321577c504ebd83e01b17c539372e769b63019e4ce
6
+ metadata.gz: 0786240f76d29bb086fdd5b196f39761986f89aaa03a3f61116ac55e59ae8206607c8fc5c5cc2ad30b89d15fc39606f52af301ca50f670307404c257f9f2bcfd
7
+ data.tar.gz: 92f2bb8cfe4d4c6fd16e01a66d8fdd9c27d488786844ff96b409b37507291ff4f349c2e151d98e0e81eaf12ccc652c7f3569fffcbbd4d452f82ac83fe2f3f204
@@ -1,3 +1 @@
1
1
  Qa::Authorities::Local.load_config(File.expand_path("../../authorities.yml", __FILE__))
2
-
3
- Qa::Authorities::Local::TableBasedAuthority.check_for_index
@@ -1,19 +1,22 @@
1
1
  module Qa::Authorities
2
2
  class Local::TableBasedAuthority < Base
3
3
  def self.check_for_index
4
- conn = ActiveRecord::Base.connection
5
- if table_or_view_exists? && !conn.indexes('local_authority_entries').find { |i| i.name == 'index_local_authority_entries_on_lower_label' }
6
- Rails.logger.error "You've installed local authority tables, but you haven't indexed the label. Rails doesn't support functional indexes in migrations, so you'll have to add this manually:\n" \
7
- "CREATE INDEX \"index_qa_local_authority_entries_on_lower_label\" ON \"qa_local_authority_entries\" (local_authority_id, lower(label))\n" \
8
- " OR on Sqlite: \n" \
9
- "CREATE INDEX \"index_qa_local_authority_entries_on_lower_label\" ON \"qa_local_authority_entries\" (local_authority_id, label collate nocase)\n" \
10
- " OR for MySQL use the MSQLTableBasedAuthority instead, since mysql does not support functional indexes."
4
+ @checked_for_index ||= begin
5
+ conn = ActiveRecord::Base.connection
6
+ if table_or_view_exists? && !conn.indexes('local_authority_entries').find { |i| i.name == 'index_local_authority_entries_on_lower_label' }
7
+ Rails.logger.error "You've installed local authority tables, but you haven't indexed the label. Rails doesn't support functional indexes in migrations, so you'll have to add this manually:\n" \
8
+ "CREATE INDEX \"index_qa_local_authority_entries_on_lower_label\" ON \"qa_local_authority_entries\" (local_authority_id, lower(label))\n" \
9
+ " OR on Sqlite: \n" \
10
+ "CREATE INDEX \"index_qa_local_authority_entries_on_lower_label\" ON \"qa_local_authority_entries\" (local_authority_id, label collate nocase)\n" \
11
+ " OR for MySQL use the MSQLTableBasedAuthority instead, since mysql does not support functional indexes."
12
+ end
11
13
  end
12
14
  end
13
15
 
14
16
  attr_reader :subauthority
15
17
 
16
18
  def initialize(subauthority)
19
+ self.class.check_for_index
17
20
  @subauthority = subauthority
18
21
  end
19
22
 
@@ -1,3 +1,3 @@
1
1
  module Qa
2
- VERSION = "0.10.0"
2
+ VERSION = "0.10.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Anderson
@@ -15,7 +15,7 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2016-08-16 00:00:00.000000000 Z
18
+ date: 2016-09-27 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rails