Skip to content

Commit

Permalink
Update dummy resources
Browse files Browse the repository at this point in the history
  • Loading branch information
excid3 committed Feb 5, 2021
1 parent 1eb3c81 commit f3aa501
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions test/dummy/app/controllers/madmin/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ class ApplicationController < Madmin::BaseController

def authenticate_admin_user
# TODO: Add your authentication logic here
# For example, we can redirect if the user isn't an admin

# For example, we could redirect if the user isn't an admin
# redirect_to "/", alert: "Not authorized." unless user_signed_in? && current_user.admin?
end

Expand All @@ -15,7 +16,7 @@ def authenticate_admin_user
# Authenticate with Devise
# before_action :authenticate_user!

# Basic Auth
# Authenticate with Basic Auth
# http_basic_authenticate_with(name: Rails.application.credentials.admin_username, password: Rails.application.credentials.admin_password)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ class ActiveStorage::BlobResource < Madmin::Resource
attribute :preview_image, index: false

# Associations
attribute :variant_records
attribute :attachments
end
6 changes: 3 additions & 3 deletions test/dummy/app/madmin/resources/post_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ class PostResource < Madmin::Resource
# Attributes
attribute :id, form: false
attribute :title
attribute :body, index: false
attribute :comments_count, form: false
attribute :metadata
attribute :created_at, form: false
attribute :updated_at, form: false
attribute :body, index: false
attribute :image, index: false
attribute :attachments, index: false
attribute :created_at
attribute :updated_at

# Associations
attribute :user
Expand Down
1 change: 1 addition & 0 deletions test/dummy/app/madmin/resources/user_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ class UserResource < Madmin::Resource
# Associations
attribute :posts
attribute :comments
attribute :habtms
end

0 comments on commit f3aa501

Please sign in to comment.