Overriding ActiveRecord's find method





ranking Sort Sort   |   date Sort Sort   |   member Sort Sort
Syndication

7
Date Submitted Thu. Nov. 2nd, 2006 1:49 AM
Revision 1
Scripter SCoon
Tags List | Random | Ruby
Comments 1 comments
Weighted random selection from the list.

Don't forget to call itemsChanged after updating list content.
5
Date Submitted Mon. Oct. 30th, 2006 6:30 AM
Revision 1
Scripter SCoon
Tags Email | http | Mail | RSS | Ruby
Comments 0 comments
This snippet illustrates following:

1. Using http request to get the data
2. Parsing RSS feeds
3. Sending email
8
Date Submitted Mon. Oct. 30th, 2006 4:42 AM
Revision 1
Scripter SCoon
Tags FreeMind | Java | Mindmaps | Ruby | Web | XML
Comments 0 comments
This code illustrates using ruby REXML package. It converts J2EE web application deployment descriptor web.xml into Freemind mindmap document.
5
Date Submitted Mon. Oct. 30th, 2006 2:15 AM
Revision 1
Scripter SCoon
Tags "Command Line" | GUI | Ruby | Tk
Comments 0 comments
This class illustrates mixed GUI/command line parameters passing. Any parameter may be specified in the command line. All unspecified parameters will be read using GUI dialog box.
5
Date Submitted Mon. Oct. 30th, 2006 1:03 AM
Revision 1
Scripter SCoon
Tags C | CPlusPlus | Java | Ruby | String
Comments 3 comments
This class intended to collect TODO comments from java/c++/etc source files.

Example:

protected readFileData (String path) throws IOException {
// TODO: add try...catch block for IOException
InputStream is = new FileInputStream(path);
...
}


See also DirectoryScanner class.
8
Date Submitted Mon. Oct. 30th, 2006 12:17 AM
Revision 1
Scripter SCoon
Tags Directory | File | Ruby
Comments 0 comments
Customizable recursive directory scanner.
4
Date Submitted Thu. Oct. 19th, 2006 4:36 PM
Revision 1
Beginner lagsalot
Tags rails
Comments 0 comments
This will render a flash div only if there is a message in flash. Also will set the id to the flash key.

flash[:notice] returns

This is the notice
8
Date Submitted Wed. Oct. 11th, 2006 5:28 PM
Revision 1
Helper jeremec
Tags console | rails | reload | Ruby
Comments 1 comments
When doing a lot of testing in script/console, you often have to reload to pickup changes in DB schema, models and libs. The process of quitting the console and restarting it can become incredibly tedious amidst bugtracking.

note: I don't believe this reloads items in the libs dir
2
Date Submitted Wed. Aug. 9th, 2006 5:49 AM
Revision 1
Beginner plinge
Tags Ruby | signals | slots
Comments 0 comments
Well, ruby is actually so flexible that there is no real need to implement the goode olde signals & slots metaphor. But it serves nicely as demonstration of ruby properties, so here we go.
1
Date Submitted Fri. Jun. 16th, 2006 9:01 AM
Revision 1
Beginner cyu
Tags migration | rails | rake | Ruby
Comments 0 comments
By default, migrations will run on the development environment. Here's how you would specify another environment.