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
| # Adding general indexes: | |
| deleted_at = User.arel_table[:deleted_at] | |
| da_is_null = Arel::Nodes::Equality.new(deleted_at, nil).to_sql | |
| # => "\"users\".\"deleted_at\" IS NULL" | |
| remove_index :users, :email | |
| add_index :users, :email, where: da_is_null | |
| # Adding unique indexes: |
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
| product_filter_copy: ......................................................................................... | |
| product_master: ................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................. |
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
| production: | |
| classic: | |
| after_symlink: | |
| - command: cd $STACK_PATH && mkdir -p tmp && mkdir -p tmp/production-class-after-symlink && chmod 777 -R tmp/ | |
| target: rails | |
| apply_during: all | |
| run_on: all_servers | |
| after_rails: | |
| - command: sudo mkdir $STACK_PATH/tmp && sudo mkdir $STACK_PATH/tmp/production-class-after-rails && sudo chmod 0775 -R $STACK_PATH/tmp |
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
| module Spree | |
| module Api | |
| module V2 | |
| class SessionsController < Spree::UserSessionsController | |
| def create | |
| authenticate_spree_user! | |
| if spree_user_signed_in? | |
| render json: try_spree_current_user, serializer: Spree::UserSerializer | |
| else |
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
| // app/initializers/current-user.js | |
| export function initialize(container, application) { | |
| var store = container.lookup('store:main'); | |
| console.log(store); | |
| } | |
| export default { | |
| name: 'current-user', | |
| after: 'preload', |
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
| # app/templates/products/index.embl | |
| section.container | |
| h1 Products | |
| ul | |
| each product in products | |
| li = link-to product.name 'products.show' product | |
| = outlet |
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
| export function initialize(container, application) { | |
| application.deferReadiness(); | |
| Ember.$.getJSON("/api/preload.json", function(json) { | |
| var store = container.lookup('store:main'); | |
| store.load(application.Product, json.products); // undefined is not a function. | |
| application.advanceReadiness(); | |
| }); | |
| } | |
| export default { |
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
| { | |
| "name": "ember-app", | |
| "dependencies": { | |
| "ember": "emberjs/ember.js#idempotent-rerender", | |
| "ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3", | |
| "ember-cli-test-loader": "ember-cli-test-loader#0.1.3", | |
| "ember-data": "1.0.0-beta.15", | |
| "ember-load-initializers": "ember-cli/ember-load-initializers#0.1.4", | |
| "ember-qunit": "0.3.1", | |
| "ember-qunit-notifications": "0.0.7", |
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
| module Spree | |
| class CheckoutService | |
| include ApplicationService | |
| attr_reader :order, :order_params | |
| def call(order, order_params) | |
| @order, @order_params = order, order_params | |
| order.email ||= order.user.email |
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
| nickel-demo $ cargo run --verbose | |
| Fresh pkg-config v0.1.6 | |
| Compiling rust-mustache v0.3.0 (https://github.com/nickel-org/rust-mustache.git#fd5d0e1c) | |
| Running `rustc /Users/benmorgan/.cargo/git/checkouts/rust-mustache-b850d4795ca6321d/master/src/lib.rs --crate-name mustache --crate-type lib -g -C metadata=48f7150e9c575dbb -C extra-filename=-48f7150e9c575dbb --out-dir /Users/benmorgan/Sites/sandbox/rust/nickel-demo/target/deps --emit=dep-info,link -L dependency=/Users/benmorgan/Sites/sandbox/rust/nickel-demo/target/deps -L dependency=/Users/benmorgan/Sites/sandbox/rust/nickel-demo/target/deps -Awarnings` | |
| Fresh nickel_macros v0.0.1 (https://github.com/nickel-org/nickel.rs.git#4e7b5dda) | |
| Fresh rustc-serialize v0.2.9 | |
| Fresh phantom v0.0.3 | |
| Fresh unsafe-any v0.2.1 | |
| Fresh matches v0.1.2 | |
| Fresh libc v0.1.0 |