Skip to content

Commit

Permalink
Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
FooBarWidget committed Aug 4, 2011
1 parent 0f7e32c commit d9e9f05
Show file tree
Hide file tree
Showing 19 changed files with 261 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Gemfile
@@ -1,12 +1,15 @@
source 'http://rubygems.org'

gem 'rails', '3.0.0'
gem 'rails', '3.0.9'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3-ruby', :require => 'sqlite3'

gem 'schema_plus'
gem 'default_value_for'

# Use unicorn as the web server
# gem 'unicorn'

Expand Down
85 changes: 85 additions & 0 deletions Gemfile.lock
@@ -0,0 +1,85 @@
GEM
remote: http://rubygems.org/
specs:
abstract (1.0.0)
actionmailer (3.0.9)
actionpack (= 3.0.9)
mail (~> 2.2.19)
actionpack (3.0.9)
activemodel (= 3.0.9)
activesupport (= 3.0.9)
builder (~> 2.1.2)
erubis (~> 2.6.6)
i18n (~> 0.5.0)
rack (~> 1.2.1)
rack-mount (~> 0.6.14)
rack-test (~> 0.5.7)
tzinfo (~> 0.3.23)
activemodel (3.0.9)
activesupport (= 3.0.9)
builder (~> 2.1.2)
i18n (~> 0.5.0)
activerecord (3.0.9)
activemodel (= 3.0.9)
activesupport (= 3.0.9)
arel (~> 2.0.10)
tzinfo (~> 0.3.23)
activeresource (3.0.9)
activemodel (= 3.0.9)
activesupport (= 3.0.9)
activesupport (3.0.9)
arel (2.0.10)
builder (2.1.2)
default_value_for (1.0.4)
erubis (2.6.6)
abstract (>= 1.0.0)
i18n (0.5.0)
mail (2.2.19)
activesupport (>= 2.3.6)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.16)
polyglot (0.3.2)
rack (1.2.3)
rack-mount (0.6.14)
rack (>= 1.0.0)
rack-test (0.5.7)
rack (>= 1.0)
rails (3.0.9)
actionmailer (= 3.0.9)
actionpack (= 3.0.9)
activerecord (= 3.0.9)
activeresource (= 3.0.9)
activesupport (= 3.0.9)
bundler (~> 1.0)
railties (= 3.0.9)
railties (3.0.9)
actionpack (= 3.0.9)
activesupport (= 3.0.9)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.4)
rake (0.9.2)
rdoc (3.9.1)
schema_plus (0.1.2)
rails
valuable
sqlite3 (1.3.4)
sqlite3-ruby (1.3.3)
sqlite3 (>= 1.3.3)
thor (0.14.6)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.29)
valuable (0.9.1)

PLATFORMS
ruby

DEPENDENCIES
default_value_for
rails (= 3.0.9)
schema_plus
sqlite3-ruby
2 changes: 2 additions & 0 deletions app/controllers/api_controller.rb
@@ -0,0 +1,2 @@
class ApiController < ApplicationController
end
2 changes: 2 additions & 0 deletions app/helpers/api_helper.rb
@@ -0,0 +1,2 @@
module ApiHelper
end
2 changes: 2 additions & 0 deletions app/models/comment.rb
@@ -0,0 +1,2 @@
class Comment < ActiveRecord::Base
end
3 changes: 3 additions & 0 deletions app/models/site.rb
@@ -0,0 +1,3 @@
class Site < ActiveRecord::Base
default_value_for(:key) { ActiveSupport::SecureRandom.hex(20).to_i(16).to_s(36) }
end
2 changes: 2 additions & 0 deletions app/models/topic.rb
@@ -0,0 +1,2 @@
class Topic < ActiveRecord::Base
end
15 changes: 15 additions & 0 deletions db/migrate/20110804200932_create_sites.rb
@@ -0,0 +1,15 @@
class CreateSites < ActiveRecord::Migration
def self.up
create_table :sites do |t|
t.string :name, :null => false
t.string :key, :null => false
t.datetime :created_at, :null => false
t.datetime :updated_at, :null => false
t.boolean :moderated, :null => false, :default => true
end
end

def self.down
drop_table :sites
end
end
16 changes: 16 additions & 0 deletions db/migrate/20110804201024_create_topics.rb
@@ -0,0 +1,16 @@
class CreateTopics < ActiveRecord::Migration
def self.up
create_table :topics do |t|
t.integer :site_id, :null => false
t.string :identifier, :null => false
t.string :title, :null => false
t.string :origin_url, :null => false
t.datetime :created_at, :null => false
end
add_index :topics, [:site_id, :identifier], :unique => true
end

def self.down
drop_table :topics
end
end
16 changes: 16 additions & 0 deletions db/migrate/20110804201102_create_comments.rb
@@ -0,0 +1,16 @@
class CreateComments < ActiveRecord::Migration
def self.up
create_table :comments do |t|
t.integer :topic_id, :null => false, :on_update => :cascade, :on_delete => :cascade
t.boolean :passed_moderation, :null => false
t.string :author_name
t.string :author_email
t.text :content, :null => false
t.datetime :created_at, :null => false
end
end

def self.down
drop_table :comments
end
end
45 changes: 45 additions & 0 deletions db/schema.rb
@@ -0,0 +1,45 @@
# 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 => 20110804201102) do

create_table "sites", :force => true do |t|
t.string "name", :null => false
t.string "key", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.boolean "moderated", :default => true, :null => false
end

create_table "topics", :force => true do |t|
t.integer "site_id", :null => false
t.string "identifier", :null => false
t.string "title", :null => false
t.string "origin_url", :null => false
t.datetime "created_at", :null => false
t.index ["site_id", "identifier"], :name => "index_topics_on_site_id_and_identifier", :unique => true
t.index ["site_id"], :name => "index_topics_on_site_id"
t.foreign_key ["site_id"], "sites", ["id"], :on_update => :no_action, :on_delete => :no_action
end

create_table "comments", :force => true do |t|
t.integer "topic_id", :null => false
t.boolean "passed_moderation", :null => false
t.string "author_name"
t.string "author_email"
t.text "content", :null => false
t.datetime "created_at", :null => false
t.index ["topic_id"], :name => "index_comments_on_topic_id"
t.foreign_key ["topic_id"], "topics", ["id"], :on_update => :cascade, :on_delete => :cascade
end

end
11 changes: 11 additions & 0 deletions test/fixtures/comments.yml
@@ -0,0 +1,11 @@
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html

# This model initially had no columns defined. If you add columns to the
# model remove the '{}' from the fixture names and add the columns immediately
# below each fixture, per the syntax in the comments below
#
one: {}
# column: value
#
two: {}
# column: value
11 changes: 11 additions & 0 deletions test/fixtures/sites.yml
@@ -0,0 +1,11 @@
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html

# This model initially had no columns defined. If you add columns to the
# model remove the '{}' from the fixture names and add the columns immediately
# below each fixture, per the syntax in the comments below
#
one: {}
# column: value
#
two: {}
# column: value
11 changes: 11 additions & 0 deletions test/fixtures/topics.yml
@@ -0,0 +1,11 @@
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html

# This model initially had no columns defined. If you add columns to the
# model remove the '{}' from the fixture names and add the columns immediately
# below each fixture, per the syntax in the comments below
#
one: {}
# column: value
#
two: {}
# column: value
8 changes: 8 additions & 0 deletions test/functional/api_controller_test.rb
@@ -0,0 +1,8 @@
require 'test_helper'

class ApiControllerTest < ActionController::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end
8 changes: 8 additions & 0 deletions test/unit/comment_test.rb
@@ -0,0 +1,8 @@
require 'test_helper'

class CommentTest < ActiveSupport::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end
4 changes: 4 additions & 0 deletions test/unit/helpers/api_helper_test.rb
@@ -0,0 +1,4 @@
require 'test_helper'

class ApiHelperTest < ActionView::TestCase
end
8 changes: 8 additions & 0 deletions test/unit/site_test.rb
@@ -0,0 +1,8 @@
require 'test_helper'

class SiteTest < ActiveSupport::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end
8 changes: 8 additions & 0 deletions test/unit/topic_test.rb
@@ -0,0 +1,8 @@
require 'test_helper'

class TopicTest < ActiveSupport::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end

0 comments on commit d9e9f05

Please sign in to comment.