Hello Conrad,
I am making good progress towards resolving this, but am not there
entirely. Following is my abbreviated environment.rb file. Note that I
have commented out the RAILS_GEM_VERSION line so that the latest rails
2.3.2 is loaded.
# Specifies gem version of Rails to use when vendor/rails is not present
#RAILS_GEM_VERSION = '2.1.2' unless defined? RAILS_GEM_VERSION
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
Rails::Initializer.run do |config|
# Add additional load paths for your own custom dirs
config.load_paths += %W( #{RAILS_ROOT}/app/form_builders )
config.time_zone = 'UTC'
config.action_controller.session = {
:session_key => '_pizzeria_session',
:secret =>
'1cac89a5ef8e67d30b297648243baee84a52d16dbbf11690733a73c825da43c327a6552f9498d0fe2ecf29cbc09ebf6115102fe3d26f969909f005dc1da39e09'
}
require "#{RAILS_ROOT}/lib/active_record_extensions.rb"
end
if I comment out the last require
"#{RAILS_ROOT}/lib/active_record_extensions.rb"
statement as shown below:
# require "#{RAILS_ROOT}/lib/active_record_extensions.rb"
and restart the server then it boots and everything works fine except
where I need the functionality contained in
lib/active_record_extensions.rb file which is as follows:
module ActiveRecord
class Base
def self.search(search, current_page, search_field)
if search.blank?
paginate(:all, :page => current_page || 1, :per_page => 5)
else
paginate(:all, :conditions => ["#{search_field} LIKE ?",
"%#{search}%"], :order => 'name',
:page => current_page || 1, :per_page => 5)
end
end
end
end
Why does Rails 2.3.2 have a problem with it when 2.1.2 does not? The
error messages are very misleading and point to some problem with
database when there is none?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---