require the job in plugin
This commit is contained in:
		
							parent
							
								
									1feb997122
								
							
						
					
					
						commit
						b94a01359a
					
				|  | @ -1,16 +1,7 @@ | ||||||
| # Discourse forces the namespace at top level :( |  | ||||||
| 
 | 
 | ||||||
| module Jobs | module Jobs | ||||||
|   class AwardGroup |   class AwardGroup < ::Jobs::Onceoff | ||||||
|     def perform(args) |     def execute_onceoff(args) | ||||||
|       puts '====================== The Job was performed ===========================' |  | ||||||
|     end |  | ||||||
| 
 |  | ||||||
|     def self.perform_in(arg, opts) |  | ||||||
|       puts '====================== The Job was enqueued ===========================' |  | ||||||
|     end |  | ||||||
| 
 |  | ||||||
|     def execute(args) |  | ||||||
|       puts '====================== The Job was executed ===========================' |       puts '====================== The Job was executed ===========================' | ||||||
|       user = User.find_by_email(args[:email]) |       user = User.find_by_email(args[:email]) | ||||||
|       if user.present? |       if user.present? | ||||||
|  |  | ||||||
|  | @ -1,4 +1,3 @@ | ||||||
| require_relative '../../app/jobs/award_group' |  | ||||||
| 
 | 
 | ||||||
| module ::DiscourseDonations | module ::DiscourseDonations | ||||||
|   class Engine < ::Rails::Engine |   class Engine < ::Rails::Engine | ||||||
|  |  | ||||||
|  | @ -11,6 +11,8 @@ load File.expand_path('../lib/discourse_donations/engine.rb', __FILE__) | ||||||
| enabled_site_setting :discourse_donations_enabled | enabled_site_setting :discourse_donations_enabled | ||||||
| 
 | 
 | ||||||
| after_initialize do | after_initialize do | ||||||
|  |   load File.expand_path('../app/jobs/award_group.rb', __FILE__) | ||||||
|  | 
 | ||||||
|   # Must be placed on every page for fraud protection. |   # Must be placed on every page for fraud protection. | ||||||
|   header_script = '<script src="https://js.stripe.com/v3/"></script>' |   header_script = '<script src="https://js.stripe.com/v3/"></script>' | ||||||
|   discourse_donations_theme = Theme.find_or_create_by(name: 'Discourse Donations Header', hidden: false, user_id: -1) |   discourse_donations_theme = Theme.find_or_create_by(name: 'Discourse Donations Header', hidden: false, user_id: -1) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue