This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This method finds related articles using Jaccard index (optimized for PostgreSQL). | |
| # More info: http://en.wikipedia.org/wiki/Jaccard_index | |
| class Article < ActiveRecord::Base | |
| def related(limit=10) | |
| Article.find_by_sql(%Q{ | |
| SELECT | |
| a.*, | |
| ( SELECT array_agg(t.name) FROM taggings tg, tags t |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| #set -x | |
| # | |
| # chkconfig: 2345 99 01 | |
| # description: starts and stops torquebox | |
| TORQUEBOX_JBOSS_USER=torquebox | |
| if [ "$TORQUEBOX_JBOSS_USER" = "RUNASIS" ]; then | |
| SUBIT="" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This needs to be called after one of the gemfile templates | |
| apply 'http://datamapper.org/templates/rails/config.rb' | |
| apply 'http://datamapper.org/templates/rails/database.yml.rb' | |
| inject_into_file 'app/controllers/application_controller.rb', | |
| "require 'dm-rails/middleware/identity_map'\n", | |
| :before => 'class ApplicationController' | |
| inject_into_class 'app/controllers/application_controller.rb', |
NewerOlder