Ruby APIs for NoSQL

At GoGaRuco (Golden Gate RubyConf) today in San Francisco, CA… Talk by: Sarah Mei, Pivotal Labs How you store data in Ruby without using a relational database. ActiveModel compliant libraries mongoDB: mongoid – gem: mongoid How do you unify a model with a data scattered across multiple stores? This is not solved yet. How do […]

Real World Ruby Testing

At GoGaRuco (Golden Gate RubyConf) today in San Francisco, CA… Rein Henrichs’ talk: Testing Frameworks: Test::Unit RSpec Shoulda Mintest Micronaut Bacon … RSPec (BDD Framework) Shoulda (BDD Framework for Test::Unit) Minitest (Replaces Test::Unit in 1.9, BDD syntax, it’s very fast) Micronaut (Light-weight BDD framework, API compatible with RSpec) Bacon (very lightweight RSpec clone, around 350 […]

Succeeding at Open Source Development

At GoGaRuco (Golden Gate RubyConf) today… Here’s what I got out of the Open Source Development talk: If you want to build up your open source project and manage it properly, you have to be open to newer contributors who are enthusiastic, even if they build a feature you think is useless. Communication is important. […]

Perforce corrupts Scripts

On windows, I am mapping a linux drive. So in Perforce, when I do a perforce sync, the files on linux will get updated. After doing this, vs doing a perforce sync on the command line on Linux itself, I noticed that the script/server and script/generate commands didn’t work without typing “ruby ” in front […]

auto_complete Plugin and Virtual Attributes

The way you normally specify which fields in your form should auto complete, is to add a declaration within your controller that looks like: However, this only works for actual fields that exist in your database, not for virtual attributes. So :field_name cannot be a virtual attribute, but should be a real existing database field. […]

Debugging Routes

To see how an external request would map to your internal path: Sample: To reload routes.rb if you made changes to it: ActionController::Routing::Routes.reload —- To generate a path use generate method:

Wym_Editor (WYSIWYM) Plugin for Rails

The wym_editor (WYSIWYM – “What you see is what you mean”) plugin is pretty cool. It allows you to define which form fields you want to offer WYSIWYM editing functionality. This makes it easier for you to edit fields and give them styles. It also allows you to see the HTML source view while you […]

SET data type in MySQL and ActiveRecord

I figured out something cool which solves a common database design problem. However, I’m not sure if this is supported in ActiveRecord since the SET data type does not exist in all databases. Let’s say each record in a table has zero or more properties and your set of properties is pre-defined. How would you […]

Dealing with Money in Rails

In process of determining how to handle fields such as price, in Rails, I’ve conducted some research. There seems to be a debate on whether to use decimal or integer as the price field. In case of where integer data types are used, the integer actually will store the price in cents. One argument for […]

RVM and Frozen Rails Conflict

I have an existing rails application and want to switch to using RVM in order to tie particular versions of Ruby, Rails and RubyGems to this application. My existing Rails application has a frozen Rails version 2.2.2 tied into it and so exists in my vendor/rails directory. Before I installed RVM, the following question came […]