diff --git a/app/models/notification_service.rb b/app/models/notification_service.rb index c71b948..13d0932 100644 --- a/app/models/notification_service.rb +++ b/app/models/notification_service.rb @@ -11,11 +11,26 @@ class NotificationService field :api_token, :type => String field :subdomain, :type => String field :sender_name, :type => String + field :notify_at_notices, :type => Array, :default => Errbit::Config.notify_at_notices embedded_in :app, :inverse_of => :notification_service validate :check_params + if Errbit::Config.per_app_notify_at_notices + Fields = [[:notify_at_notices, + { :placeholder => 'comma separated numbers or simply 0 for every notice', + :label => 'notify on errors (0 for all errors)' + } + ]] + else + Fields = [] + end + + def notify_at_notices + Errbit::Config.per_app_notify_at_notices ? super : Errbit::Config.notify_at_notices + end + # Subclasses are responsible for overwriting this method. def check_params; true; end -- libgit2 0.21.2