Permalink
Browse files

finished the basic setup of BulkApi but GET /bulk/api isn't returning…

… anything
  • Loading branch information...
1 parent f29e517 commit 2da31f5e9636aa245615899b1659c848f16210a0 @drnic committed Jun 7, 2011
View
@@ -1,5 +1,6 @@
source 'http://rubygems.org'
+gem 'rake', '0.9.2'
gem 'rails', '3.0.7'
# Bundle edge Rails instead:
View
@@ -99,4 +99,5 @@ PLATFORMS
DEPENDENCIES
bulk_api
rails (= 3.0.7)
+ rake (= 0.9.2)
sqlite3
@@ -3,7 +3,7 @@ class ApplicationResource < Bulk::Resource
# To do so, just uncomment the next line and set resources that should be
# available in Bulk API:
#
- # resources :tasks, :projects
+ # resources :todos
end
View
@@ -0,0 +1,5 @@
+class Todo < ActiveRecord::Base
+ # def as_json(options={})
+ # super(:only => [:title, :is_done])
+ # end
+end
View
@@ -1,8 +1 @@
-# ==========================================================================
-# Project: Todos
-# Copyright: @2011 My Company, Inc.
-# ==========================================================================
-
-# Add initial buildfile information here
-config :all, :required => ["sproutcore/core_foundation", "sproutcore/datastore"], :theme => "sproutcore/empty_theme"
-
+config :all, :required => [:sproutcore, "sproutcore/core_foundation", "bulk_data_source"], :theme => "sproutcore/empty_theme"
@@ -1,11 +1,12 @@
Todos = SC.Application.create({
- store: SC.Store.create().from(SC.Record.fixtures)
+ store: SC.Store.create().from('SC.BulkDataSource')
});
Todos.Todo = SC.Record.extend({
title: SC.Record.attr(String),
isDone: SC.Record.attr(Boolean, { defaultValue: NO })
});
+Todos.Todo.resourceName = 'todo';
Todos.CreateTodoView = SC.TextField.extend({
insertNewline: function() {
@@ -0,0 +1,14 @@
+class CreateTodos < ActiveRecord::Migration
+ def self.up
+ create_table :todos do |t|
+ t.string :title
+ t.boolean :is_done
+
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :todos
+ end
+end
View
@@ -0,0 +1,22 @@
+# This file is auto-generated from the current state of the database. Instead
+# of editing this file, please use the migrations feature of Active Record to
+# incrementally modify your database, and then regenerate this schema definition.
+#
+# Note that this schema.rb definition is the authoritative source for your
+# database schema. If you need to create the application database on another
+# system, you should be using db:schema:load, not running all the migrations
+# from scratch. The latter is a flawed and unsustainable approach (the more migrations
+# you'll amass, the slower it'll run and the greater likelihood for issues).
+#
+# It's strongly recommended to check this file into your version control system.
+
+ActiveRecord::Schema.define(:version => 20110607011513) do
+
+ create_table "todos", :force => true do |t|
+ t.string "title"
+ t.boolean "is_done"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+end
View
@@ -0,0 +1,9 @@
+# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
+
+one:
+ title: MyString
+ is_done: false
+
+two:
+ title: MyString
+ is_done: false
View
@@ -0,0 +1,8 @@
+require 'test_helper'
+
+class TodoTest < ActiveSupport::TestCase
+ # Replace this with your real tests.
+ test "the truth" do
+ assert true
+ end
+end

0 comments on commit 2da31f5

Please sign in to comment.