Created
March 7, 2012 19:23
-
-
Save dlitvakb/1995289 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| is_mismatch: function (alert) { | |
| return alert.alert_tyoe === "listing_mismatch"; | |
| }, | |
| is_info_missing: function (alert) { | |
| return alert.alert_type === "listing_info_missing"; | |
| }, | |
| has_mismatch: function () { | |
| var that = this; | |
| return _.any(this.alerts, function (alert) { | |
| return that.is_mismatch(alert); | |
| }); | |
| }, | |
| has_info_missing: function () { | |
| var that = this; | |
| return _.any(this.alerts, function (alert) { | |
| return that.is_info_missing(alert); | |
| }); | |
| }, | |
| has_location_mismatch: function () { | |
| if (this.has_mismatch() || this.has_info_missing()) { | |
| return _.any(this.alerts, function (alert) { | |
| return _.any(alert.alert_data.info_type, function (mismatch) { | |
| return _.indexOf(['street_number', 'route', 'city', 'state', 'postal_code'], | |
| mismatch) != -1; | |
| }); | |
| }); | |
| } | |
| return false; | |
| }, | |
| has_contact_info_mismatch: function () { | |
| if (this.has_mismatch() || this.has_info_missing()) { | |
| return _.any(this.alerts, function (alert) { | |
| return _.any(alert.alert_data.info_type, function (mismatch) { | |
| return _.indexOf(['url', 'email','phone', 'fax'], | |
| mismatch) != -1; | |
| }); | |
| }); | |
| } | |
| return false; | |
| }, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment