Skip to content

Commit

Permalink
Merge pull request #1347 from SplitTime/oveson/madmin-resource-for-fi…
Browse files Browse the repository at this point in the history
…le-downloads

Add Analytics::FileDownload and Lotteries::EntrantServiceDetail to madmin
  • Loading branch information
moveson authored Dec 19, 2024
2 parents 08c2b0e + c8e8c4a commit 561e730
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/controllers/madmin/analytics/file_downloads_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module Madmin
class Analytics::FileDownloadsController < Madmin::ResourceController
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module Madmin
class Lotteries::EntrantServiceDetailsController < Madmin::ResourceController
end
end
27 changes: 27 additions & 0 deletions app/madmin/resources/analytics/file_download_resource.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
class Analytics::FileDownloadResource < Madmin::Resource
# Attributes
attribute :id, form: false
attribute :name
attribute :filename
attribute :byte_size
attribute :created_at, form: false
attribute :updated_at, form: false

# Associations
attribute :user
attribute :record

# Uncomment this to customize the display name of records in the admin area.
# def self.display_name(record)
# record.name
# end

# Uncomment this to customize the default sort column and direction.
# def self.default_sort_column
# "created_at"
# end
#
# def self.default_sort_direction
# "desc"
# end
end
28 changes: 28 additions & 0 deletions app/madmin/resources/lotteries/entrant_service_detail_resource.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
class Lotteries::EntrantServiceDetailResource < Madmin::Resource
# Attributes
attribute :lottery_entrant_id
attribute :form_accepted_at
attribute :form_rejected_at
attribute :form_accepted_comments
attribute :form_rejected_comments
attribute :created_at, form: false
attribute :updated_at, form: false
attribute :completed_form, index: false

# Associations
attribute :entrant

# Uncomment this to customize the display name of records in the admin area.
# def self.display_name(record)
# record.name
# end

# Uncomment this to customize the default sort column and direction.
# def self.default_sort_column
# "created_at"
# end
#
# def self.default_sort_direction
# "desc"
# end
end
4 changes: 4 additions & 0 deletions config/routes/madmin.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Below are the routes for madmin
namespace :madmin do
namespace :lotteries do
resources :entrant_service_details
end
resources :historical_facts
namespace :analytics do
resources :file_downloads
resources :sendgrid_events
end
resources :connections
Expand Down

0 comments on commit 561e730

Please sign in to comment.