Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 4 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
Showing with 142 additions and 115 deletions.
  1. +4 −8 Gemfile
  2. +58 −86 Gemfile.lock
  3. +1 −1 Guardfile
  4. +1 −1 app/models/field.rb
  5. +78 −19 config/mongoid.yml
View
12 Gemfile
@@ -1,12 +1,11 @@
source 'http://rubygems.org'
-gem 'rails', '~> 3.1'
+gem 'rails', '~> 3.2'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
-gem "mongoid", "~> 2.1"
-gem "bson_ext", "~> 1.3"
+gem "mongoid", "~> 3"
gem "haml-rails"
gem 'devise'
gem 'mongoid-tree', :require => 'mongoid/tree'
@@ -14,8 +13,8 @@ gem 'mongoid-tree', :require => 'mongoid/tree'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
- gem 'sass-rails', "~> 3.1.0.rc"
- gem 'coffee-rails', "~> 3.1.0.rc"
+ gem 'sass-rails', "~> 3.2"
+ gem 'coffee-rails', "~> 3.2"
gem 'uglifier'
end
@@ -31,7 +30,6 @@ gem 'jquery-rails'
# gem 'ruby-debug19', :require => 'ruby-debug'
group :development, :test do
- gem 'ruby-debug19'
gem 'guard'
gem 'guard-rspec'
gem 'rb-fsevent'
@@ -44,6 +42,4 @@ group :development, :test do
gem 'database_cleaner'
gem 'factory_girl_rails', :require => false
gem 'capybara'
- gem 'hirb'
- gem 'hirb-unicode'
end
View
144 Gemfile.lock
@@ -1,42 +1,36 @@
GEM
remote: http://rubygems.org/
specs:
- actionmailer (3.1.8)
- actionpack (= 3.1.8)
- mail (~> 2.3.3)
- actionpack (3.1.8)
- activemodel (= 3.1.8)
- activesupport (= 3.1.8)
+ actionmailer (3.2.9)
+ actionpack (= 3.2.9)
+ mail (~> 2.4.4)
+ actionpack (3.2.9)
+ activemodel (= 3.2.9)
+ activesupport (= 3.2.9)
builder (~> 3.0.0)
erubis (~> 2.7.0)
- i18n (~> 0.6)
- rack (~> 1.3.6)
+ journey (~> 1.0.4)
+ rack (~> 1.4.0)
rack-cache (~> 1.2)
- rack-mount (~> 0.8.2)
rack-test (~> 0.6.1)
- sprockets (~> 2.0.4)
- activemodel (3.1.8)
- activesupport (= 3.1.8)
+ sprockets (~> 2.2.1)
+ activemodel (3.2.9)
+ activesupport (= 3.2.9)
builder (~> 3.0.0)
- i18n (~> 0.6)
- activerecord (3.1.8)
- activemodel (= 3.1.8)
- activesupport (= 3.1.8)
- arel (~> 2.2.3)
+ activerecord (3.2.9)
+ activemodel (= 3.2.9)
+ activesupport (= 3.2.9)
+ arel (~> 3.0.2)
tzinfo (~> 0.3.29)
- activeresource (3.1.8)
- activemodel (= 3.1.8)
- activesupport (= 3.1.8)
- activesupport (3.1.8)
- multi_json (>= 1.0, < 1.3)
+ activeresource (3.2.9)
+ activemodel (= 3.2.9)
+ activesupport (= 3.2.9)
+ activesupport (3.2.9)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
addressable (2.3.2)
- archive-tar-minitar (0.5.2)
- arel (2.2.3)
+ arel (3.0.2)
bcrypt-ruby (3.0.1)
- bson (1.8.0)
- activesupport
- bson_ext (1.8.0)
- bson (~> 1.8.0)
builder (3.0.4)
capybara (2.0.1)
mime-types (>= 1.16)
@@ -48,14 +42,13 @@ GEM
childprocess (0.3.6)
ffi (~> 1.0, >= 1.0.6)
coderay (1.0.8)
- coffee-rails (3.1.1)
+ coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
- railties (~> 3.1.0)
+ railties (~> 3.2.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.4.0)
- columnize (0.3.6)
database_cleaner (0.9.1)
devise (2.1.2)
bcrypt-ruby (~> 3.0)
@@ -92,11 +85,8 @@ GEM
haml (~> 3.1)
railties (>= 3.1, < 4.1)
hike (1.2.1)
- hirb (0.7.0)
- hirb-unicode (0.0.5)
- hirb (~> 0.5)
- unicode-display_width (~> 0.1.1)
i18n (0.6.1)
+ journey (1.0.4)
jquery-rails (2.1.4)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
@@ -104,60 +94,57 @@ GEM
libwebsocket (0.1.7.1)
addressable
websocket
- linecache19 (0.5.12)
- ruby_core_source (>= 0.1.4)
listen (0.7.0)
lumberjack (1.0.2)
- mail (2.3.3)
+ mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
method_source (0.8.1)
mime-types (1.19)
- mongo (1.8.0)
- bson (~> 1.8.0)
- mongoid (2.5.1)
+ mongoid (3.0.16)
activemodel (~> 3.1)
- mongo (~> 1.7)
+ moped (~> 1.1)
+ origin (~> 1.0)
tzinfo (~> 0.3.22)
- mongoid-rspec (1.4.5)
- mongoid (>= 2.4.6)
+ mongoid-rspec (1.5.5)
+ mongoid (>= 3.0.1)
rake
rspec (>= 2.9)
- mongoid-tree (0.7.0)
- mongoid (~> 2.0)
- multi_json (1.2.0)
+ mongoid-tree (1.0.1)
+ mongoid (>= 3.0, <= 4.0)
+ moped (1.3.2)
+ multi_json (1.5.0)
nokogiri (1.5.6)
+ origin (1.0.11)
orm_adapter (0.4.0)
polyglot (0.3.3)
pry (0.9.10)
coderay (~> 1.0.5)
method_source (~> 0.8)
slop (~> 3.3.1)
- rack (1.3.6)
+ rack (1.4.1)
rack-cache (1.2)
rack (>= 0.4)
- rack-mount (0.8.3)
- rack (>= 1.0.0)
rack-ssl (1.3.2)
rack
rack-test (0.6.2)
rack (>= 1.0)
- rails (3.1.8)
- actionmailer (= 3.1.8)
- actionpack (= 3.1.8)
- activerecord (= 3.1.8)
- activeresource (= 3.1.8)
- activesupport (= 3.1.8)
+ rails (3.2.9)
+ actionmailer (= 3.2.9)
+ actionpack (= 3.2.9)
+ activerecord (= 3.2.9)
+ activeresource (= 3.2.9)
+ activesupport (= 3.2.9)
bundler (~> 1.0)
- railties (= 3.1.8)
- railties (3.1.8)
- actionpack (= 3.1.8)
- activesupport (= 3.1.8)
+ railties (= 3.2.9)
+ railties (3.2.9)
+ actionpack (= 3.2.9)
+ activesupport (= 3.2.9)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
- thor (~> 0.14.6)
+ thor (>= 0.14.6, < 2.0)
rake (10.0.3)
rb-fsevent (0.9.2)
rdoc (3.12)
@@ -177,23 +164,12 @@ GEM
rspec-core (~> 2.12.0)
rspec-expectations (~> 2.12.0)
rspec-mocks (~> 2.12.0)
- ruby-debug-base19 (0.11.25)
- columnize (>= 0.3.1)
- linecache19 (>= 0.5.11)
- ruby_core_source (>= 0.1.4)
- ruby-debug19 (0.11.6)
- columnize (>= 0.3.1)
- linecache19 (>= 0.5.11)
- ruby-debug-base19 (>= 0.11.19)
- ruby_core_source (0.1.5)
- archive-tar-minitar (>= 0.5.2)
rubyzip (0.9.9)
sass (3.2.4)
- sass-rails (3.1.6)
- actionpack (~> 3.1.0)
- railties (~> 3.1.0)
+ sass-rails (3.2.5)
+ railties (~> 3.2.0)
sass (>= 3.1.10)
- tilt (~> 1.3.2)
+ tilt (~> 1.3)
selenium-webdriver (2.27.2)
childprocess (>= 0.2.5)
libwebsocket (~> 0.1.3)
@@ -201,11 +177,12 @@ GEM
rubyzip
slop (3.3.3)
spork (0.9.2)
- sprockets (2.0.4)
+ sprockets (2.2.2)
hike (~> 1.2)
+ multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
- thor (0.14.6)
+ thor (0.16.0)
tilt (1.3.3)
treetop (1.4.12)
polyglot
@@ -214,7 +191,6 @@ GEM
uglifier (1.3.0)
execjs (>= 0.3.0)
multi_json (~> 1.0, >= 1.0.2)
- unicode-display_width (0.1.1)
warden (1.2.1)
rack (>= 1.0)
webrat (0.7.3)
@@ -229,9 +205,8 @@ PLATFORMS
ruby
DEPENDENCIES
- bson_ext (~> 1.3)
capybara
- coffee-rails (~> 3.1.0.rc)
+ coffee-rails (~> 3.2)
database_cleaner
devise
factory_girl_rails
@@ -240,17 +215,14 @@ DEPENDENCIES
guard-rspec
guard-spork
haml-rails
- hirb
- hirb-unicode
jquery-rails
- mongoid (~> 2.1)
+ mongoid (~> 3)
mongoid-rspec
mongoid-tree
- rails (~> 3.1)
+ rails (~> 3.2)
rb-fsevent
rspec-rails
- ruby-debug19
- sass-rails (~> 3.1.0.rc)
+ sass-rails (~> 3.2)
spork (~> 0.9.0.rc)
uglifier
webrat
View
2 Guardfile
@@ -9,7 +9,7 @@ guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAIL
watch('spec/spec_helper.rb')
end
-guard 'rspec', :cli => "-c -f doc", :version => 2 do
+guard 'rspec', :cli => "-c -f doc" do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec/" }
View
2 app/models/field.rb
@@ -3,7 +3,7 @@ class Field
include Mongoid::Tree
include Mongoid::Tree::Ordering
- belongs_to :link, :class_name => 'Field'
+ belongs_to :link, :class_name => 'Field', :inverse_of => nil
field :name, :type => String
field :no_image, :type => Boolean, :default => true
View
97 config/mongoid.yml
@@ -1,21 +1,80 @@
development:
- host: localhost
- database: eretheal_development
- identity_map_enabled: true
+ # 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: eretheal_development
+ # 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: :eventual
+
+ # How many times Moped should attempt to retry an operation after
+ # failure. (default: 30)
+ # max_retries: 30
+
+ # The time in seconds that Moped should wait before retrying an
+ # operation on failure. (default: 1)
+ # retry_interval: 1
+ # 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:
- host: localhost
- database: eretheal_test
-
-# set these environment variables on your prod server
-production:
- host: <%= ENV['MONGOID_HOST'] %>
- port: <%= ENV['MONGOID_PORT'] %>
- username: <%= ENV['MONGOID_USERNAME'] %>
- password: <%= ENV['MONGOID_PASSWORD'] %>
- database: <%= ENV['MONGOID_DATABASE'] %>
- identity_map_enabled: true
- # slaves:
- # - host: slave1.local
- # port: 27018
- # - host: slave2.local
- # port: 27019
+ sessions:
+ default:
+ database: eretheal_test
+ hosts:
+ - localhost:27017
+ options:
+ consistency: :strong
+ # In the test environment we lower the retries and retry interval to
+ # low amounts for fast failures.
+ max_retries: 1
+ retry_interval: 0

No commit comments for this range

Something went wrong with that request. Please try again.