administration-one 1.0.0 → 1.0.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: 1a5a5aaf21f14faf81ce38558d16c86a7f4950c7cfa2edd1f0ac16f157776a70
4
- data.tar.gz: ede5fb32819425bab63db3fbb764fb2c147009e9e8261e67d9b6c49256318865
3
+ metadata.gz: fa883dc65e85907d203f948c6584c36b1e1174ce7e1c8d35073c6e7a2790f685
4
+ data.tar.gz: ac078ae36a533af16d3c6d3c0997649bfcd33481a46f446e6a796622f4d1ccd0
5
5
  SHA512:
6
- metadata.gz: c8811f2e428b657bad4155cfda93bb66d2c73e7e4abff09754d4876ef241b188022cbe086e8e5eda76d8bd884114f3d376b7cadd70d4b0b08138ead730529aee
7
- data.tar.gz: 9d57bc0b477cc328ee682424be509ac2b8eaea70095fb46e2aa2163e803d2ebd57d96de7d5f7a1ef3929a5e3749dcbaabbbab3af7ce85c6be4f104e9a3ce498a
6
+ metadata.gz: 4c2d09b74b75d44f58a36c57f14187ad92f220f83e469679ec474e6f506735c3cb50ef75f796d62ec93e910f3efee408361d33f25835ccd6cead4867bf72b668
7
+ data.tar.gz: 8dd86d0b4c5f6b760408c323bb20cf28177d2047c15d25ace0701e8454ee4853a41752cc947fd65f229f838e0cad3e6e2bfceb9ca5bf091ade8791b6b8bd5f78
data/CHANGELOG.md CHANGED
@@ -1,2 +1,5 @@
1
+ ## [1.0.1] - 2025-05-24
2
+ - Bug fixes
3
+
1
4
  ## [1.0.0] - 2025-05-16
2
5
  - Initial release
@@ -1,3 +1,3 @@
1
1
  module AdministrationOne
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -26,6 +26,9 @@
26
26
 
27
27
  <dt class="col-md-3">Updated at</dt>
28
28
  <dd class="col-md-9"><%= l(@user.updated_at, format: :long) %></dd>
29
+
30
+ <dt class="col-md-3">Administrator</dt>
31
+ <dd class="col-md-9"><%= true_or_false_icon(@user.is_admin?) %></dd>
29
32
  </dl>
30
33
  </div>
31
34
  </div>
@@ -4,7 +4,7 @@
4
4
  <meta charset="utf-8"/>
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"/>
6
6
  <meta http-equiv="X-UA-Compatible" content="ie=edge"/>
7
- <title>Authentication Zero</title>
7
+ <title>Administration One &madsh; Log In</title>
8
8
 
9
9
  <%= csrf_meta_tags %>
10
10
  <%= csp_meta_tag %>
@@ -1,11 +1,11 @@
1
1
  require "open-uri"
2
2
  class AttachAvatarToUserJob < ApplicationJob
3
3
  queue_as :default
4
-
4
+
5
5
  def perform(**args)
6
6
  user = args[:user]
7
7
  size = 512
8
- colors = %w[ 066fd1 ]
8
+ colors = %w[ 066fd1 ae3ec9 d6336c d63939 f76707 f59f00 0ca678 17a2b8 ]
9
9
 
10
10
  unless user.nil?
11
11
  seed = URI.encode_uri_component user.username
@@ -18,4 +18,4 @@ class AttachAvatarToUserJob < ApplicationJob
18
18
  end
19
19
  end
20
20
  end
21
- end
21
+ end
@@ -25,8 +25,6 @@ class User < ApplicationRecord
25
25
 
26
26
  def reattach_avatar_to_user
27
27
  if saved_change_to_attribute?(:username)
28
- self.avatar.purge
29
- AttachAvatarToUserJob.perform_now(user: self)
30
28
  self.avatar.purge
31
29
  AttachAvatarToUserJob.perform_later(user: self)
32
30
  end
@@ -15,11 +15,11 @@ module Admin
15
15
 
16
16
  def ask_about_wysiwyg
17
17
  return if behavior == :revoke
18
- if attributes_names.include?('content')
18
+ if attributes_names.include?("content")
19
19
  puts "\n" * 2
20
20
  puts "There was attribute named \"content\" passed to generator's options. Do you want to use EditorJS for it?"
21
21
  answer = ask "Type \"Y\" or \"Yes\ to use EditorJS. Or anything else not to use it."
22
- ["y", "yes"].include?(answer.downcase) ? @use_editor_js = true : @use_editor_js = false
22
+ [ "y", "yes" ].include?(answer.downcase) ? @use_editor_js = true : @use_editor_js = false
23
23
  end
24
24
  end
25
25
 
@@ -61,7 +61,7 @@ EOF
61
61
  file = "app/models/#{singular_table_name}.rb"
62
62
  insertion = " def self.ransackable_attributes(auth_object = nil)\n #{attributes_to_array_string}\n end\n"
63
63
  if File.exist?(file)
64
- inject_into_class file, "#{singular_table_name.capitalize}", insertion
64
+ inject_into_class file, "#{class_name} < ApplicationRecord", insertion, force: true
65
65
  end
66
66
  end
67
67
 
@@ -103,17 +103,17 @@ EOF
103
103
  end
104
104
 
105
105
  def attributes_to_array_string
106
- '%w[' + attributes_hash.map { |k, _| "#{k}" }.join(" ") + ']'
106
+ "%w[" + attributes_hash.map { |k, _| "#{k}" }.join(" ") + "]"
107
107
  end
108
108
 
109
109
  def attributes_hash
110
110
  return {} if attributes_names.empty?
111
111
 
112
112
  attributes_names.filter_map do |name|
113
- if %w(password password_confirmation).include?(name) && attributes.any?(&:password_digest?)
114
- ["#{name}", '"secret"']
113
+ if %w[password password_confirmation].include?(name) && attributes.any?(&:password_digest?)
114
+ [ "#{name}", '"secret"' ]
115
115
  elsif !virtual?(name)
116
- ["#{name}", "@#{singular_table_name}.#{name}"]
116
+ [ "#{name}", "@#{singular_table_name}.#{name}" ]
117
117
  end
118
118
  end.sort.to_h
119
119
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: administration-one
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Beregovoy
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-05-15 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  email:
13
13
  - thismailis4spam@icloud.com
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  - !ruby/object:Gem::Version
119
119
  version: '0'
120
120
  requirements: []
121
- rubygems_version: 3.6.2
121
+ rubygems_version: 3.6.7
122
122
  specification_version: 4
123
123
  summary: An administration system generator for Rails applications
124
124
  test_files: []