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
require 'rspec/mocks' | |
class ClassForMocking | |
end | |
RSpec::Mocks::setup(ClassForMocking) |
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
# 1. ================ | |
# Could work (never tried) | |
Rails.application.routes.draw do | |
load 'routes/admin' # file includes just the routes | |
load 'routes/crm' # file includes just the routes | |
resources :customer |
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
<posts> | |
<post> | |
<attr></attr> | |
<comments> | |
<comment> ... </comment> | |
... | |
</comments> | |
</post> | |
</posts> |
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
class Object | |
def arrayify | |
[*self] | |
end | |
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
class NewTrohpyRoute | |
def self.matches?(request) | |
trophy_id = request.params[:trophy_id] # Not sure if you can get the params this way | |
return NewTrophy.where(:id => trophy_id).count > 1 | |
end | |
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
When I try to find a model in the console, i get an error. | |
MyApp.User.find(98) | |
> TypeError: Object Ember has no method 'merge' |
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
App.User = DS.Model.extend | |
#... | |
addresses: DS.hasMany(GleichklangWeb.Address, { embedded: true }) | |
App.Address = DS.Model.extend | |
#... | |
user: DS.belongsTo(GleichklangWeb.User) |
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
App.Router.map -> | |
@resource 'portal', -> | |
@route 'dashboard' | |
@resource 'developers', -> | |
@resource 'messages', -> | |
@route 'inbox' | |
@route 'hidden' | |
@resource 'sysops', -> |
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
locationToUse = if window.history.replaceState then 'history' else 'hash' | |
App.Router.reopen | |
location: locationToUse |
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
DS.RESTAdapter.configure("plurals", | |
galleries: "galleries" # If your model is called App.Galleries | |
gallery: "galleries" # If your model is called App.Gallery | |
) |
OlderNewer