rabarber 5.2.0 → 5.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 70a773c884c0e207de25a518ff864d25ff13cd1a05c712c88efd17d264782d52
4
- data.tar.gz: 901200cff398f2355a307aff03c9e63f1bcdbecf07369bf768fe7f12ebed9151
3
+ metadata.gz: 86f27dfa62e1520493b6803b3e7fcc55025ff07af38d3b7f5fd60b0d8bcbe548
4
+ data.tar.gz: 7ef5aacdb3f9fb3a95b799307a74c7e9764167613cfa1506f4bf75205af84ecc
5
5
  SHA512:
6
- metadata.gz: dd83d11d1c831f3ecb5ea36fb6d650113453f5e30b5cfdfb1affb58a515a5f77da33eb067a03abde379997f47c7e8c44d5abdf05c3a1b363d778215241406ad0
7
- data.tar.gz: 130c1c65c3d5bc2e33b788e35f4a790586784ced24a20a110b106303729a2c5a798330e5e05abfe6ebf58902a63761af99909443a92b2dcec496f6d26136926e
6
+ metadata.gz: 15ea45c42082ba4c4832c6dc58b2f70a2b35b5d206bf428faae89ce4646a5a666edd025f434d51b8c531077e4425f2b7e8a2b9208b412495971777bee79d1916
7
+ data.tar.gz: 9f7883fe80aa5a24ab7ccbe6fe751c28f08138b1e7f291ef831572c3530d6b0bdfe9e99ba281f9ee0dd4fcdfd56119713b87779fa455651d3f3d2a1b55733008
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## v5.2.1
2
+
3
+ ### Bugs:
4
+
5
+ - Fixed error raised on Rails console commands when the database was not yet set up
6
+
1
7
  ## v5.2.0
2
8
 
3
9
  ### Features:
@@ -4,9 +4,15 @@ require "rails/railtie"
4
4
 
5
5
  module Rabarber
6
6
  class Railtie < Rails::Railtie
7
+ def self.table_exists?
8
+ ActiveRecord::Base.connection.data_source_exists?("rabarber_roles")
9
+ rescue ActiveRecord::NoDatabaseError, ActiveRecord::ConnectionNotEstablished
10
+ false
11
+ end
12
+
7
13
  initializer "rabarber.to_prepare" do |app|
8
14
  app.config.to_prepare do
9
- if ActiveRecord::Base.connection.data_source_exists?("rabarber_roles")
15
+ if Rabarber::Railtie.table_exists?
10
16
  Rabarber::Role.where.not(context_type: nil).distinct.pluck(:context_type).each do |context_class|
11
17
  context_class.constantize
12
18
  rescue NameError => e
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rabarber
4
- VERSION = "5.2.0"
4
+ VERSION = "5.2.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rabarber
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.0
4
+ version: 5.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - enjaku4