Permalink
Browse files

Changed the example app to make use of the generator and added files …

…generated by the generator.
  • Loading branch information...
1 parent d3bbd4b commit 7f93ece8d1f11b64f585abd8d9abcf28a0d58ed5 @felipero committed Apr 17, 2010
@@ -1,7 +1,7 @@
source 'http://rubygems.org'
gem 'rails', '3.0.0.beta3'
-gem 'couchrails', :git => 'git://github.com/victorhg/couchrails.git'
+gem 'couchrails'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
@@ -1,6 +1,8 @@
class Post < CouchRails::Document
- view_by :title
- property :title
- property :content
+ property :title
+ property :content
+ property :Comments, :cast_as => 'Comment'
+
+ timestamps!
end
@@ -35,11 +35,11 @@ class Application < Rails::Application
# config.i18n.default_locale = :de
# Configure generators values. Many other options are available, be sure to check the documentation.
- # config.generators do |g|
- # g.orm :active_record
+ config.generators do |g|
+ g.orm :couchrails
# g.template_engine :erb
# g.test_framework :test_unit, :fixture => true
- # end
+ end
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
@@ -0,0 +1,11 @@
+# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
+
+one:
+ title: MyString
+ content: MyString
+ Comments:
+
+two:
+ title: MyString
+ content: MyString
+ Comments:
@@ -0,0 +1,8 @@
+require 'test_helper'
+
+class PostTest < ActiveSupport::TestCase
+ # Replace this with your real tests.
+ test "the truth" do
+ assert true
+ end
+end

0 comments on commit 7f93ece

Please sign in to comment.