discourse/app/services
riking 1833b43ae2 FEATURE: Badge query validation, preview results, and EXPLAIN
Upon saving a badge or requesting a badge result preview,
BadgeGranter.contract_checks! will examine the provided badge SQL for
some contractual obligations - namely, the returned columns and use of
trigger parameters.

Saving the badge is wrapped in a transaction to make this easier, by
raising ActiveRecord::Rollback on a detected violation.

On the client, a modal view is added for the badge query sample run
results, named admin-badge-preview.
The preview action is moved up to the route.
The save action, on failure, triggers a 'saveError' action (also in the
route).

The preview action gains a new parameter, 'explain', which will give the
output of an EXPLAIN query for the badge sql, which can be used by forum
admins to estimate the cost of their badge queries.
The preview link is replaced by two links, one which omits (false) and
includes (true) the EXPLAIN query.

The Badge.save() method is amended to propogate errors.

Badge::Trigger gets some utility methods for use in the
BadgeGranter.contract_checks! method.

Additionally, extra checks outside of BadgeGranter.contract_checks! are
added in the preview() method, to cover cases of null granted_at
columns.

An uninitialized variable path is removed in the backfill() method.

TODO - it would be nice to be able to get the actual names of all
columns the provided query returns, so we could give more errors
2014-08-31 11:25:44 -07:00
..
spam_rule Refactor SpamRulesEnforcer so that each spam rule is in its own class 2013-10-25 13:25:02 -04:00
badge_granter.rb FEATURE: Badge query validation, preview results, and EXPLAIN 2014-08-31 11:25:44 -07:00
color_scheme_revisor.rb Add descriptions. Make all the actions buttons. Add a revert button to colors. Add a new variable: quaternary. 2014-05-14 10:19:00 -04:00
group_message.rb BUGFIX: no translation for email_error_notifications to admin users 2014-06-30 15:21:26 +02:00
handle_chunk_upload.rb FEATURE: Bulk Invite 2014-06-09 01:43:39 +05:30
post_alerter.rb FIX: don't notify on link reflections 2014-07-29 15:40:05 +10:00
spam_rules_enforcer.rb Refactor SpamRulesEnforcer so that each spam rule is in its own class 2013-10-25 13:25:02 -04:00
staff_action_logger.rb Log badge grant/revoke to the staff actions log. 2014-03-21 11:10:07 +05:30
tracked_topics_updater.rb Refactor User#update_last_seen! and User#update_tracked_topics 2013-10-23 23:27:30 +02:00
user_activator.rb Remove hub username integration 2014-07-16 12:25:24 -04:00
user_authenticator.rb BUGFIX: twitter auth asking for a password 2014-03-20 14:49:25 +11:00
user_blocker.rb Don't send more pm's after a user has been blocked from making posts. This can happen if a staff member flags posts that are already hidden. 2013-08-02 10:55:19 -04:00
user_destroyer.rb FIX: before nuking a user, do a real count of posts instead of relying on user_stat record 2014-08-18 12:07:29 -04:00
user_updater.rb Avoid using to_s when performing String Interpolation 2014-08-14 23:55:27 +05:30
username_checker_service.rb Remove hub username integration 2014-07-16 12:25:24 -04:00