Skip to content

Instantly share code, notes, and snippets.

import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Dusan'
});
@dusanstanojeviccs
dusanstanojeviccs / adapters.application.js
Last active October 30, 2017 21:07
Issue With Records
/*jshint unused:false*/
import DS from 'ember-data';
export default DS.RESTAdapter.extend({
try: 0,
findAll(modelName, query, params, modelClass) {
// we return different records
this.set("try", this.get("try") + 3);
{
"data": {
"email": "dusan.stanojevic.cs@gmail.com"
}
}
eyJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7ImVtYWlsIjoiZHVzYW4uc3Rhbm9qZXZpYy5jc0BnbWFpbC5jb20ifX0.fcsKMrL5Vvo5ejV4wVrVLiBhnzqioX0iLrr8Ya7D6Rc
eyJkYXRhIjp7ImVtYWlsIjoiZHVzYW4uc3Rhbm9qZXZpYy5jc0BnbWFpbC5jb20ifX0
CREATE DATABASE bookstore;
CREATE TABLE `books` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(64) DEFAULT NULL,
`description` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
name := """play-rest-book-db"""
version := "1.0-SNAPSHOT"
lazy val root = (project in file(".")).enablePlugins(PlayJava)
scalaVersion := "2.12.2"
libraryDependencies += guice
......
play.modules {
# By default, Play will load any class called Module that is defined
# in the root package (the "app" directory), or you can define them
# explicitly below.
# If there are any built-in modules that you want to disable, you can list them here.
#enabled += my.application.Module
# If there are any built-in modules that you want to disable, you can list them here.
package books;
import com.google.inject.Inject;
import play.db.Database;
import play.libs.Json;
import play.mvc.Controller;
import play.mvc.Result;
public class BookController extends Controller {