pin database_cleaner to version 1.0.1

The tests were failing with:
~/.rvm/gems/ruby-2.0.0-p247/gems/database_cleaner-1.1.0/lib/database_cleaner/active_record/truncation.rb:123:in `db_version': undefined local variable or method `postgresql_version' for #<ActiveRecord::ConnectionAdapters::SQLite3Adapter:0x007fd28ac70df8> (NameError)

Here's the bug report: https://github.com/bmabey/database_cleaner/issues/224

Looks like it might be a while until a fix happens so for the time
being we'll pin database_cleaner to version 1.0.1 which appears to
work.
replace rspec stub!() with stub() to quiet deprecation warnings

DEPRECATION: stub! is deprecated. Use stub instead. Called from ~/surveyor/spec/models/dependency_spec.rb:71:in `block (2 levels) in <top (required)>'.

http://www.mail-archive.com/rspec-users@rubyforge.org/msg13270.html

   The original method was stub!, which I will confess to introducing,
   and for the wrong reasons, due to my misunderstanding of the meaning
   of ! in ruby methods.

   I recently added stub (with no !) with no particular fanfare, as I
   don't intend to remove stub! (at least not any time soon). Right now
   the docs don't make it clear, so I need to fix that - but I'd say that
   stub() is the method to use and stub!() is there for backwards
   compatibility.
replace Relation#all with other methods to quiet deprecation warnings

DEPRECATION WARNING: Relation#all is deprecated. If you want to eager-load a relation, you can call #load (e.g. `Post.where(published: true).load`). If you want to get an array of records from a relation, you can call #to_a (e.g. `Post.where(published: true).to_a`). (called from to_hash at /Users/tcabot/Code/surveyor/lib/surveyor/models/dependency_condition_methods.rb:39)
refactor call to find(:first) to quiet deprecation warnings

DEPRECATION WARNING: Calling #find(:first) is deprecated. Please call #first directly instead. (called from edit at ~/surveyor/lib/surveyor/surveyor_controller_methods.rb:63)

Refactored so that we call either first() or find() depending on
whether we've got a primary key or not.
fix deprecation warnings about calling find_by with options

DEPRECATION WARNING: Calling find_by or find_by! methods with options is deprecated. Build a scope instead, e.g. User.where('age > 21').find_by_name('Jon'). (called from block in load_and_update_response_set at ~/surveyor/lib/surveyor/surveyor_controller_methods.rb:112)
fix deprecation warnings about calling scope() with a hash

DEPRECATION WARNING: Calling #scope or #default_scope with a hash is deprecated. Please use a lambda containing a scope. E.g. scope :red, -> { where(color: 'red') }. (called from included at ~/surveyor/lib/surveyor/models/answer_methods.rb:13)

We use instance_eval because we need the scope lambda to run in the
context of the including Class, not the Module in which the code is
defined.
fix deprecation warnings relating to has_many declarations

DEPRECATION WARNING: The following options in your ResponseSet.has_many :responses declaration are deprecated: :order. Please use a scope block instead.

We use instance_eval because we need the scope lambda to run in the
context of the including Class, not the Module in which the code is
defined.
removed "unloadable" declarations

They were causing circular dependency errors in development when
classes changed and had to be recompiled.  Turns out they're no longer
needed for Rails 4:

   https://github.com/thoughtbot/clearance/issues/276
   https://github.com/thoughtbot/clearance/pull/277

In development if I change one of the classes it recompiles, even
without the "unloadable" declaration, and I no longer get circular
dependency errors.
move images to where sprockets expects them to be

Sprockets expects images in an engine to be in an [engine name]
directory, but the jquery ui images weren't.

The jquery ui stylesheet had to change, too, to reference images
starting at "/" rather than relative URL's.
fix code that figures out if the asset pipeline is enabled

The Rails3-compatible algorithm to figure out if the asset pipeline is
doesn't work with Rails4.  Quite frankly, the new one doesn't seem as
clean as the old one, but hopefully this code will work in all cases.

https://github.com/rails/rails/issues/10334

Note that the specs didn't seem to test both cases, or else the image
path is now the same whether the pipeline is enabled or not, but in
any case the specs don't need to determine whether the pipeline is
enabled, they can use the same path in all cases.
Merge pull request #1 from caboteria/master

quiet Rails4 deprecation warnings