Revision 35c14172
Added by Ivan Necas over 7 years ago
app/validators/bookmark_controller_validator.rb | ||
---|---|---|
class BookmarkControllerValidator < ActiveModel::EachValidator
|
||
@@active_record_tables = ActiveRecord::Base.connection.tables.map(&:to_s)
|
||
def validate_each(record, attribute, value)
|
||
controllers = ["dashboard"] + (active_record_tables + Permission.resources.map {|x| x.tableize }).uniq
|
||
controllers = ["dashboard"] + (@@active_record_tables + Permission.resources.map {|x| x.tableize }).uniq
|
||
record.errors[attribute] << _("%{value} is not a valid controller") % {:value => value } unless controllers.include?(value)
|
||
end
|
||
|
||
private
|
||
|
||
def active_record_tables
|
||
ActiveRecord::Base.connection.tables.map(&:to_s)
|
||
end
|
||
end
|
Also available in: Unified diff
Refs #15779 - make background processing unavailable for now (#4217)
The original PR got vetted in the packaging phase and including
foreman-task as dependency of Foreman was refused. We need to rethink
our approach for getting the foreman-tasks functionality available
inside the core and take less obtrusive approach by making the
transition in several steps, until the foreman core will get on
future-parity with foreman-tasks which would effectively mean tasks in
core.
To clean the tasks that were created while using the original changes,
you can run:
This reverts commits