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
Shop.controller "OrderCycleCtrl", ($scope, $rootScope, OrderCycle) -> | |
$scope.changeOrderCycle = -> | |
OrderCycle.set_order_cycle($scope.order_cycle_id) | |
Shop.factory 'OrderCycle', ($resource) -> | |
class OrderCycle | |
@set_order_cycle: (id)-> | |
console.log "setting order cycle " + id | |
# Ajaxy shit here |
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
angular.module("Shop").controller "ProductsCtrl", ($scope, Product) -> | |
$scope.products = Product.all() | |
Shop.factory 'Product', ($resource) -> | |
class Product | |
@all: -> | |
response = $resource("/shop/products").query() |
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
%select{"ng-model" => "order_cycle_id", "ng-options" => "c.id for c in #{@order_cycles.to_json}"} | |
%option{value: ""} Please Select |
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
%select{"ng-model" => "order_cycle_id"} | |
%option{value: ""} Please Select | |
%option{value: 27} 27 | |
%option{value: 29} 29 | |
{{ order_cycle_id }} | |
Shop.controller "OrderCycleCtrl", ($scope, OrderCycle) -> | |
$scope.order_cycle_id = 27 | |
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
Expected [ { test : 'cats' } ] to be [ { test : 'cats' } ] | |
WTF? | |
describe 'Shop services', -> | |
$httpBackend = null | |
Product = null | |
beforeEach -> | |
module 'Shop' |
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
Shop.factory 'Product', ($resource) -> | |
class Product | |
@all: -> | |
$resource("/shop/products").query() | |
describe 'Shop services', -> | |
$httpBackend = null | |
Product = null |
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
OK! Interesting design question for y'all. | |
I have a model called Enterprise. Enterprises can be distributors, suppliers or both. | |
In the UI we access everything either as a distributor or as a supplier. | |
About 75% of the distributor/supplier functionality is shared, and the tables are identical. | |
However, A: that the views/controllers are different, and B: distributors and suppliers each | |
have their own set of scopes etc. | |
I want to be able to access my distributors and suppliers as separate models, so I can A: keep |
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
%li{:class => ("active" if true)} | |
Blah | |
Gives me | |
<li> | |
Blah | |
</li> |
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
it "gives me the pickup time for an order_cycle" do | |
d = create(:distributor_enterprise, name: 'Green Grass') | |
oc1 = create(:simple_order_cycle, name: 'oc 1', distributors: [d]) | |
exchange = Exchange.find(oc1.exchanges.to_enterprises(d).outgoing.first.id) | |
exchange.update_attribute :pickup_time, "turtles" | |
helper.stub!(:current_order_cycle).and_return oc1 | |
helper.pickup_time.should == "turtles" | |
end |
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
#Embedded file name: /Volumes/Jenkins/live/Projects/AppLive/Resources/MIDI Remote Scripts/_Framework/SubjectSlot.py | |
""" | |
Family of classes for maintaining connections with optional subjects. | |
""" | |
from itertools import izip, repeat | |
from functools import partial, wraps | |
from Signal import Signal | |
from Util import instance_decorator, monkeypatch, monkeypatch_extend, NamedTuple | |
from Disconnectable import Disconnectable, CompoundDisconnectable |