I have several questions about patch fast_tracking_9502.diff Numerex recently provided.
1) I managed to apply the patch to the most part of the project. But there were 5 files that have not been patched and patch command gave the following results on that files:
patching file lib/daemons/notifier.rb
Hunk #1 FAILED at 3.
Hunk #2 FAILED at 19.
2 out of 2 hunks FAILED -- saving rejects to file lib/daemons/notifier.rb.rej
Four other files are db/schema.rb, config/database.yml, config/environments/test.rb, config/environments/development.rb. I had to do the modifications specified in .diff file manually to those files. But what do those errors mean?
2) After applying the patch and manual modifications I tried to call rake db:migrate. It failed with the following error:
Missing these required gems:
binarylogic-searchlogic >= 2.2.3
mislav-will_paginate >= 2.3.11
I discovered the following lines were added to environment.db with the patch:
config.gem 'binarylogic-searchlogic',
:lib => 'searchlogic',
:version => '>= 2.2.3',
:source => 'http://gems.github.com'
config.gem 'mislav-will_paginate',
:lib => 'will_paginate',
:version => '>= 2.3.11',
:source => 'http://gems.github.com'
I tried to install those gems:
gem install searchlogic... Successfully installed searchlogic-2.3.5
gem install will_paginate... Successfully installed will_paginate-2.2.2
But error was still there. And rake db:migrate worked only after I commented those new lines in environment.db. What is the correct way to handle this issue?
3) After I started the server and tried to login to my local test account I got the following error in browser:
uninitialized constant Device::GeofenceViolation
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:105:in `const_missing'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:2199:in `compute_type'
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:2195:in `compute_type'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/reflection.rb:156:in `send'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/reflection.rb:156:in `klass'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/reflection.rb:187:in `quoted_table_name'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/associations.rb:1413:in `configure_dependency_for_has_many'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/associations.rb:823:in `has_many'
(eval):3:in `has_many'
%PROJECT_PATH%/app/models/device.rb:31
%PROJECT_PATH%/app/controllers/home_controller.rb:6:in `index
, where %PROJECT_PATH% is the path to the project on the local drive. device.rb:31 is the following:
has_many :geofence_violations, :order => "geofence_id ASC", :dependent => :destroy, :conditions => 'EXISTS(SELECT * FROM geofences WHERE geofences.id = geofence_id)'
But there is no GeofenceViolation model, it wasn’t added by the patch. So I added it manually, restarted server and it helped. So the question is - where is GeofenceViolation model? 