Skip to content

Commit e015094

Browse files
committed
pr comments
1 parent fe41ca2 commit e015094

3 files changed

Lines changed: 12 additions & 9 deletions

File tree

app/admin/admin_users.rb

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,21 @@
33
ActiveAdmin.register AdminUser do
44
permit_params :email, :password, :password_confirmation
55

6-
remove_filter :email, :encrypted_password, :reset_password_token, :reset_password_sent_at, :remember_created_at
7-
86
index do
97
selectable_column
108
id_column
119
column :email
12-
column :current_sign_in_at
13-
column :sign_in_count
1410
column :created_at
1511
actions
1612
end
1713

18-
filter :email
19-
filter :current_sign_in_at
20-
filter :sign_in_count
21-
filter :created_at
14+
show do
15+
attributes_table do
16+
row :id
17+
row :email
18+
row :created_at
19+
end
20+
end
2221

2322
form do |f|
2423
f.inputs do

app/models/application_record.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@
22

33
class ApplicationRecord < ActiveRecord::Base
44
primary_abstract_class
5+
6+
def self.ransackable_attributes(auth_object = nil)
7+
authorizable_ransackable_attributes
8+
end
59
end

spec/factories/admin_users.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
FactoryBot.define do
44
factory :admin_user do
5-
sequence(:email) { |n| "admin#{n}@3maccounting.ca" }
5+
email { Faker::Internet.email }
66
password { Faker::Internet.password(min_length: 6) }
77
end
88
end

0 commit comments

Comments
 (0)