Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update echo to latest master

  • Loading branch information...
commit c8403bca596aaaf6106cb9ea8c7a2bde98b14685 1 parent f818407
Durran Jordan durran authored
1  Gemfile
View
@@ -2,7 +2,6 @@ source "http://rubygems.org"
gem "rails", "~> 3.2"
-gem "bson_ext"
gem "bundler"
gem "carrierwave"
gem "carrierwave-mongoid", require: "carrierwave/mongoid"
32 Gemfile.lock
View
@@ -1,10 +1,10 @@
GIT
remote: git://github.com/mongoid/mongoid.git
- revision: 13413bdfd430226eec20fa2eff8886665f1ab6c9
+ revision: 2ad3f087b159b51bf20152336c8eab65754666d3
specs:
mongoid (3.0.0)
activemodel (~> 3.1)
- mongo (~> 1.3)
+ moped (~> 1.0.0.alpha)
origin (~> 1.0.0.beta)
tzinfo (~> 0.3.22)
@@ -39,12 +39,10 @@ GEM
i18n (~> 0.6)
multi_json (~> 1.0)
arel (3.0.2)
- bson (1.6.1)
- bson_ext (1.6.1)
- bson (~> 1.6.1)
builder (3.0.0)
- carrierwave (0.5.8)
- activesupport (~> 3.0)
+ carrierwave (0.6.2)
+ activemodel (>= 3.2.0)
+ activesupport (>= 3.2.0)
carrierwave-mongoid (0.1.0)
carrierwave
mongoid
@@ -54,7 +52,7 @@ GEM
coffee-script (2.2.0)
coffee-script-source
execjs
- coffee-script-source (1.2.0)
+ coffee-script-source (1.3.1)
decent_exposure (1.0.2)
diff-lcs (1.1.3)
erubis (2.7.0)
@@ -65,17 +63,17 @@ GEM
guard (1.0.1)
ffi (>= 0.5.0)
thor (~> 0.14.6)
- guard-rspec (0.6.0)
+ guard-rspec (0.7.0)
guard (>= 0.10.0)
haml (3.1.4)
hike (1.2.1)
i18n (0.6.0)
journey (1.0.3)
- jquery-rails (2.0.1)
+ jquery-rails (2.0.2)
railties (>= 3.2.0, < 5.0)
thor (~> 0.14)
json (1.6.6)
- kgio (2.7.2)
+ kgio (2.7.4)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
@@ -84,8 +82,7 @@ GEM
mime-types (1.18)
mocha (0.10.5)
metaclass (~> 0.0.1)
- mongo (1.6.1)
- bson (~> 1.6.1)
+ moped (1.0.0.alpha)
multi_json (1.2.0)
origin (1.0.0.beta)
polyglot (0.3.3)
@@ -129,7 +126,7 @@ GEM
railties (>= 3.0)
rspec (~> 2.9.0)
sass (3.1.15)
- sass-rails (3.2.4)
+ sass-rails (3.2.5)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
@@ -143,11 +140,11 @@ GEM
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
- tzinfo (0.3.32)
- uglifier (1.2.3)
+ tzinfo (0.3.33)
+ uglifier (1.2.4)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
- unicorn (4.2.0)
+ unicorn (4.2.1)
kgio (~> 2.6)
rack
raindrops (~> 0.7)
@@ -156,7 +153,6 @@ PLATFORMS
ruby
DEPENDENCIES
- bson_ext
bundler
carrierwave
carrierwave-mongoid
8 app/models/band.rb
View
@@ -24,10 +24,10 @@ class Band
# be unique. Description is not required but should be filled out.
validates :name, presence: true, uniqueness: true
- index "albums.producer_id", background: true
- index "genres", background: true
- index "name", background: true, unique: true
- index [[ "tours.shows.venue", Mongo::GEO2D ]], background: true
+ index genres: 1, options: { background: true }
+ index name: 1, options: { background: true, unique: true }
+ index "albums.producer_id" => 1, options: { background: true }
+ index "tours.shows.venue" => "2d", options: { background: true }
# Get all the bands that have been reviewed by the provided user.
#
1  app/models/following.rb
View
@@ -16,7 +16,6 @@ class << self
#
# @return [ Array<Hash> ] A grouping by count and band id.
def ranked
- only(:band_id).limit(10).aggregate
end
end
end
2  app/models/metadata.rb
View
@@ -6,7 +6,7 @@ class Metadata
belongs_to :document, polymorphic: true
- index "tags", background: true
+ index tags: 1, options: { background: true }
# Get all application entities that match the supplied text. Will work for
# text that is exact, on contains the text in any part of the name.
2  app/models/reference/role.rb
View
@@ -12,7 +12,7 @@ class Role
# every role.
validates :name, presence: true, uniqueness: true
- index "name", background: true
+ index name: 1, options: { background: true }
TYPES.each do |name|
6 app/models/user.rb
View
@@ -21,9 +21,9 @@ class User
# All users must have a role in order for the permissions to be effective.
validates :role, presence: true
- index "email", background: true
- index "role.name", background: true
- index "role.role_id", background: true
+ index email: 1, options: { background: true }
+ index "role.name" => 1, options: { background: true }
+ index "role.role_id" => 1, options: { background: true }
# Convenience methods for determining if the user itself is of a specific
# role in the application.
84 config/mongoid.yml
View
@@ -1,18 +1,76 @@
-defaults: &defaults
- host: localhost
- preload_models: false
-
development:
- <<: *defaults
- database: echo_dev
+ # Configure available database sessions. (required)
+ sessions:
+ # Defines the default session. (required)
+ default:
+ # Defines the name of the default database that Mongoid can connect to.
+ # (required).
+ database: echo_dev
+ # Provides the hosts the default session can connect to. Must be an array
+ # of host:port pairs. (required)
+ hosts:
+ - localhost:27017
+ options:
+ # Change whether the session persists in safe mode by default.
+ # (default: false)
+ # safe: false
+
+ # Change the default consistency model to :eventual or :strong.
+ # :eventual will send reads to secondaries, :strong sends everything
+ # to master. (default: :eventual)
+ consistency: :strong
+ # Configure Mongoid specific options. (optional)
+ options:
+ # Configuration for whether or not to allow access to fields that do
+ # not have a field definition on the model. (default: true)
+ # allow_dynamic_fields: true
+
+ # Enable the identity map, needed for eager loading. (default: false)
+ # identity_map_enabled: false
+
+ # Includes the root model name in json serialization. (default: false)
+ # include_root_in_json: false
+
+ # Include the _type field in serializaion. (default: false)
+ # include_type_for_serialization: false
+
+ # Preload all models in development, needed when models use
+ # inheritance. (default: false)
+ # preload_models: false
+
+ # Protect id and type from mass assignment. (default: true)
+ # protect_sensitive_fields: true
+
+ # Raise an error when performing a #find and the document is not found.
+ # (default: true)
+ # raise_not_found_error: true
+
+ # Raise an error when defining a scope with the same name as an
+ # existing method. (default: false)
+ # scope_overwrite_exception: false
+
+ # Skip the database version check, used when connecting to a db without
+ # admin access. (default: false)
+ # skip_version_check: false
+
+ # User Active Support's time zone in conversions. (default: true)
+ # use_activesupport_time_zone: true
+
+ # Ensure all times are UTC in the app side. (default: false)
+ # use_utc: false
test:
- <<: *defaults
- database: echo_test
+ sessions:
+ default:
+ database: echo_test
+ hosts:
+ - localhost:27017
production:
- host: <%= ENV["MONGOID_HOST"] %>
- port: <%= ENV["MONGOID_PORT"] %>
- username: <%= ENV["MONGOID_USERNAME"] %>
- password: <%= ENV["MONGOID_PASSWORD"] %>
- database: <%= ENV["MONGOID_DATABASE"] %>
+ sessions:
+ default:
+ database: <%= ENV["MONGOID_DATABASE"] %>
+ username: <%= ENV["MONGOID_USERNAME"] %>
+ password: <%= ENV["MONGOID_PASSWORD"] %>
+ hosts:
+ - "<%= ENV["MONGOID_HOST"] %>:<%= ENV["MONGOID_PORT"] %>"
2  spec/models/following_spec.rb
View
@@ -31,7 +31,7 @@
moses.follow(clash)
end
- it "returns the bands ranked by number of followings", service: :following do
+ pending "returns the bands ranked by number of followings", service: :following do
Following.ranked.should ==
[
{ "count" => 1.0, "band_id" => dead_kennedys.id },
Please sign in to comment.
Something went wrong with that request. Please try again.