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
class ActiveRecord::Base | |
class << self | |
def has_simple_search(*attrs) | |
raise 'has_simple_search expects at least one attribute' if attrs.empty? | |
instance_eval do # because this is ActiveRecord::Base, the class inherits this | |
class_attribute :simple_search_fields | |
self.simple_search_fields = attrs.flatten | |
def simple_search(search_string) | |
return find(:all) if search_string.nil? || search_string.blank? | |
attrs = self.simple_search_fields |
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
### Instructions source http://tumblr.intranation.com/post/766290743/using-dropbox-git-repository #### | |
-- make empty repo on dropbox: | |
cd ~/Dropbox/RipeApps/Git | |
mkdir -p newname.git | |
cd !$ | |
git --bare init | |
-- push your junk into it | |
cd ~/Projects/myrepo |
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
Made an update covering Macos 10.8 and ruby 2.0: https://gist.github.com/michaelsd/5224456 | |
- Install "Command Line Tools for XCode" (Get it from Apple Developer Program) or Install XCode via Appstore | |
where option one is the faster one, 170MB vs 1.xGB | |
- Install https://github.com/sstephenson/rbenv | |
git clone into your home folder; | |
set environment variables, see install docs of rbenv; | |
- Get libyaml |
NewerOlder