Skip to content

Commit

Permalink
Revert "Semi-working mongo db implementation"
Browse files Browse the repository at this point in the history
This reverts commit cf1a132.
  • Loading branch information
Thom Mahoney committed Nov 3, 2011
1 parent cf1a132 commit 749666b
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 62 deletions.
10 changes: 5 additions & 5 deletions Gemfile
Expand Up @@ -2,14 +2,12 @@ source 'http://rubygems.org'

gem 'rails', '3.0.9'

gem 'mongoid', '~> 2.2'
gem 'bson_ext', '~> 1.4'

gem 'simple_form', '1.5.1'
gem 'jquery-rails', '1.0.14'

platform :ruby do
gem 'mysql2', '~> 0.2.7'
gem 'mysql2', '~> 0.2.7'
gem 'sqlite3'
gem 'unicorn'
end

Expand All @@ -22,9 +20,11 @@ platforms :jruby do
end




# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
group :development, :test do
gem 'sqlite3'

end
10 changes: 0 additions & 10 deletions Gemfile.lock
Expand Up @@ -31,8 +31,6 @@ GEM
activesupport (3.0.9)
arel (2.0.10)
bouncy-castle-java (1.5.0146.1)
bson (1.4.0)
bson_ext (1.4.0)
builder (2.1.2)
erubis (2.6.6)
abstract (>= 1.0.0)
Expand All @@ -52,12 +50,6 @@ GEM
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.16)
mongo (1.4.0)
bson (= 1.4.0)
mongoid (2.2.4)
activemodel (~> 3.0)
mongo (~> 1.3)
tzinfo (~> 0.3.22)
mysql2 (0.2.13)
polyglot (0.3.2)
rack (1.2.4)
Expand Down Expand Up @@ -106,12 +98,10 @@ PLATFORMS

DEPENDENCIES
activerecord-jdbc-adapter
bson_ext (~> 1.4)
jdbc-mysql
jdbc-sqlite3
jquery-rails (= 1.0.14)
jruby-openssl
mongoid (~> 2.2)
mysql2 (~> 0.2.7)
rails (= 3.0.9)
simple_form (= 1.5.1)
Expand Down
6 changes: 1 addition & 5 deletions app/models/list.rb
@@ -1,8 +1,4 @@
class List
include Mongoid::Document
field :name, type: String
field :created_at, type: DateTime
field :updated_at, type: DateTime
class List < ActiveRecord::Base

validates :name, :presence => true
validates_uniqueness_of :name, :on => :create, :message => "must be unique"
Expand Down
16 changes: 5 additions & 11 deletions app/models/task.rb
@@ -1,14 +1,8 @@
class Task
include Mongoid::Document
field :name, type: String
field :done, type: Boolean
field :list_id, type: Integer
field :created_at, type: DateTime
field :updated_at, type: DateTime
class Task < ActiveRecord::Base

belongs_to :list, :class_name => "List", :foreign_key => "list_id"

validates :name, :presence => true


belongs_to :list, :class_name => "List", :foreign_key => "list_id"

validates :name, :presence => true

end
6 changes: 1 addition & 5 deletions config/application.rb
@@ -1,10 +1,6 @@
require File.expand_path('../boot', __FILE__)

require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
require "rails/test_unit/railtie"
# require "sprockets/railtie" # Uncomment this line for Rails 3.1+
require 'rails/all'

# If you have a Gemfile, require the gems listed there, including any gems
# you've limited to :test, :development, or :production.
Expand Down
22 changes: 22 additions & 0 deletions config/database.yml
@@ -0,0 +1,22 @@
# SQLite version 3.x
# gem install sqlite3
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000

production:
adapter: sqlite3
database: db/production.sqlite3
pool: 5
timeout: 5000
26 changes: 0 additions & 26 deletions config/mongoid.yml

This file was deleted.

Empty file added db/test.sqlite3
Empty file.

0 comments on commit 749666b

Please sign in to comment.