Skip to content

Commit efadb87

Browse files
committed
Rename RecurringTask#id to RecurringTask#key
To avoid any confusion with Active Record's id.
1 parent 676383f commit efadb87

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/solid_queue/dispatcher/recurring_schedule.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def load_tasks
1818
end
1919

2020
def load_task(task)
21-
scheduled_tasks[task.id] = schedule(task)
21+
scheduled_tasks[task.key] = schedule(task)
2222
end
2323

2424
def unload_tasks

lib/solid_queue/dispatcher/recurring_task.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ def wrap(args)
77
args.first.is_a?(self) ? args.first : from_configuration(args.first, **args.second)
88
end
99

10-
def from_configuration(id, **options)
11-
new(id, class_name: options[:class], schedule: options[:schedule], arguments: options[:args])
10+
def from_configuration(key, **options)
11+
new(key, class_name: options[:class], schedule: options[:schedule], arguments: options[:args])
1212
end
1313
end
1414

15-
attr_reader :id, :schedule, :class_name, :arguments
15+
attr_reader :key, :schedule, :class_name, :arguments
1616

17-
def initialize(id, class_name:, schedule:, arguments: nil)
18-
@id = id
17+
def initialize(key, class_name:, schedule:, arguments: nil)
18+
@key = key
1919
@class_name = class_name
2020
@schedule = Fugit.parse(schedule)
2121
@arguments = Array(arguments)

0 commit comments

Comments
 (0)