Project

General

Profile

« Previous | Next » 

Revision 3ab02530

Added by Kavita Gaikwad over 7 years ago

Fixes #12547 - Added validators to interger fields

With this commit, instead of postgresql exception it will
show proper validation message for interger fields.

View differences:

app/models/usergroup.rb
scope :visible, -> { }
scoped_search :on => :name, :complete_value => :true
scoped_search :relation => :roles, :on => :name, :rename => :role, :complete_value => true
scoped_search :relation => :roles, :on => :id, :rename => :role_id, :complete_enabled => false, :only_explicit => true
scoped_search :relation => :roles, :on => :id, :rename => :role_id, :complete_enabled => false, :only_explicit => true, :validator => ScopedSearch::Validators::INTEGER
validate :ensure_uniq_name, :ensure_last_admin_remains_admin
accepts_nested_attributes_for :external_usergroups, :reject_if => ->(a) { a[:name].blank? }, :allow_destroy => true

Also available in: Unified diff