diff --git a/app/models/lets_encrypt/certificate.rb b/app/models/lets_encrypt/certificate.rb index fafafdc..d634a98 100644 --- a/app/models/lets_encrypt/certificate.rb +++ b/app/models/lets_encrypt/certificate.rb @@ -26,6 +26,8 @@ class Certificate < ApplicationRecord include CertificateVerifiable include CertificateIssuable + self.table_name = 'letsencrypt_certificates' + validates :domain, presence: true, uniqueness: true scope :active, -> { where('certificate IS NOT NULL AND expires_at > ?', Time.zone.now) } diff --git a/gemfiles/rails7.gemfile.lock b/gemfiles/rails7.gemfile.lock index 2b44960..0761511 100644 --- a/gemfiles/rails7.gemfile.lock +++ b/gemfiles/rails7.gemfile.lock @@ -18,41 +18,42 @@ GEM acme-client (2.0.15) faraday (>= 1.0, < 3.0.0) faraday-retry (>= 1.0, < 3.0.0) - actionmailer (7.1.1) - actionpack (= 7.1.1) - actionview (= 7.1.1) - activejob (= 7.1.1) - activesupport (= 7.1.1) + actionmailer (7.1.3) + actionpack (= 7.1.3) + actionview (= 7.1.3) + activejob (= 7.1.3) + activesupport (= 7.1.3) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.2) - actionpack (7.1.1) - actionview (= 7.1.1) - activesupport (= 7.1.1) + actionpack (7.1.3) + actionview (= 7.1.3) + activesupport (= 7.1.3) nokogiri (>= 1.8.5) + racc rack (>= 2.2.4) rack-session (>= 1.0.1) rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actionview (7.1.1) - activesupport (= 7.1.1) + actionview (7.1.3) + activesupport (= 7.1.3) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.1.1) - activesupport (= 7.1.1) + activejob (7.1.3) + activesupport (= 7.1.3) globalid (>= 0.3.6) - activemodel (7.1.1) - activesupport (= 7.1.1) - activerecord (7.1.1) - activemodel (= 7.1.1) - activesupport (= 7.1.1) + activemodel (7.1.3) + activesupport (= 7.1.3) + activerecord (7.1.3) + activemodel (= 7.1.3) + activesupport (= 7.1.3) timeout (>= 0.4.0) - activesupport (7.1.1) + activesupport (7.1.3) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) @@ -68,9 +69,9 @@ GEM thor (>= 0.14.0) ast (2.4.2) base64 (0.2.0) - bigdecimal (3.1.4) + bigdecimal (3.1.6) builder (3.2.4) - concurrent-ruby (1.2.2) + concurrent-ruby (1.2.3) connection_pool (2.4.1) crass (1.0.6) date (3.3.4) @@ -90,13 +91,13 @@ GEM activesupport (>= 6.1) i18n (1.14.1) concurrent-ruby (~> 1.0) - io-console (0.6.0) - irb (1.8.3) + io-console (0.7.2) + irb (1.11.2) rdoc - reline (>= 0.3.8) + reline (>= 0.4.2) json (2.6.3) language_server-protocol (3.17.0.3) - loofah (2.21.4) + loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -105,16 +106,16 @@ GEM net-pop net-smtp mini_mime (1.1.5) - minitest (5.20.0) + minitest (5.22.2) mutex_m (0.2.0) - net-imap (0.4.4) + net-imap (0.4.10) date net-protocol net-pop (0.1.2) net-protocol net-protocol (0.2.2) timeout - net-smtp (0.4.0) + net-smtp (0.4.0.1) net-protocol nokogiri (1.15.4-x86_64-darwin) racc (~> 1.4) @@ -124,7 +125,7 @@ GEM parser (3.2.2.4) ast (~> 2.4.1) racc - psych (5.1.1.1) + psych (5.1.2) stringio racc (1.7.3) rack (3.0.8) @@ -142,9 +143,9 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.1.1) - actionpack (= 7.1.1) - activesupport (= 7.1.1) + railties (7.1.3) + actionpack (= 7.1.3) + activesupport (= 7.1.3) irb rackup (>= 1.0.0) rake (>= 12.2) @@ -152,14 +153,14 @@ GEM zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.1.0) - rdoc (6.6.0) + rdoc (6.6.2) psych (>= 4.0.0) redis (5.0.8) redis-client (>= 0.17.0) redis-client (0.18.0) connection_pool regexp_parser (2.8.2) - reline (0.3.9) + reline (0.4.2) io-console (~> 0.5) rexml (3.2.6) rspec-core (3.12.2) @@ -205,14 +206,14 @@ GEM simplecov-html (0.10.2) sqlite3 (1.6.8-x86_64-darwin) sqlite3 (1.6.8-x86_64-linux) - stringio (3.0.8) + stringio (3.1.0) thor (1.3.0) timeout (0.4.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) webrick (1.8.1) - zeitwerk (2.6.12) + zeitwerk (2.6.13) PLATFORMS x86_64-darwin-22 diff --git a/lib/letsencrypt.rb b/lib/letsencrypt.rb index e2b124f..5ab8e39 100644 --- a/lib/letsencrypt.rb +++ b/lib/letsencrypt.rb @@ -83,11 +83,6 @@ def config(&block) @config end - # @api private - def table_name_prefix - 'letsencrypt_' - end - def certificate_model @certificate_model ||= config.certificate_model.constantize end