Skip to content

Instantly share code, notes, and snippets.

@mileszs
Created June 22, 2010 15:20
Show Gist options
  • Select an option

  • Save mileszs/448611 to your computer and use it in GitHub Desktop.

Select an option

Save mileszs/448611 to your computer and use it in GitHub Desktop.
# question.rb
class Question < ActiveRecord::Base
validates_presence_of :body, :summary, :answer
validates_uniqueness_of :body
cattr_reader :per_page
@@per_page = 10
belongs_to :category
has_friendly_id :body, :use_slug => true
searchable do
text :body
text :summary
text :answer
end
end
# environment.rb
# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.3.5' 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/concerns )
config.gem 'formtastic'
config.gem 'will_paginate'
config.gem 'friendly_id', :version => '~> 3.0'
config.gem 'haml'
config.gem 'sunspot_rails', :lib => 'sunspot/rails'
config.time_zone = 'Eastern Time (US & Canada)'
end
Dir.glob(Rails.root.join('lib', 'extensions', '**', '*.rb')).each do |file|
require file
end
# .gems
formtastic --ignore-dependencies
will_paginate
friendly_id --version "~> 3.0" --ignore-dependencies
fastercsv
websolr-sunspot_rails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment