This file contains 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
{ styles } = require 'helpers' | |
PayoffOverview = require 'views/accounts/payoff/overview' | |
module.exports = class PayoffWindow extends Backbone.TitaniumView | |
viewName: 'Window' | |
attributes: styles.window.main |
This file contains 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
# Uses 101 (also known as n + 1 where n = 100) queries | |
mergeTransactionsBad: -> | |
all_transactions = [] | |
te_transactions = db.run "select * from te_transactions where member_id=1 order by posted_at DESC limit 100" | |
for transaction in te_transactions | |
network_transaction = db.run "select * from network_transactions where transaction_id=#{transaction.id}" | |
transaction.member_id = network_transaction.id |
This file contains 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
def within_box_or_near(location_class, box, center) | |
box.present? ? location_class.within_box(box) : location_class.near(center) | |
end | |
def filter(params) | |
locations = {} | |
within_box_or_near(Location.class_for_provider(services.shift), @box, @center).each do |location| | |
locations[location.loc_hash] = location |
This file contains 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
@model.comments.fetch | |
success: => | |
commentListView = new CommentListView | |
collection: @model.comments | |
fetchOnInit: false | |
title: 'All comments' | |
$(@el).append commentListView.render().el |
NewerOlder