Archive for the ‘Code’ Category

to_json and associations

The problem was that I wanted to get to a address that was associated with the store. I was using .to_json but this did not include the address information. First I had var store = @store.to_json but that only gave me the address_id not the address information. After a little digging I got the syntax [...]

Continue reading »

Ruby’n Rails AASM or state machine

I wanted to use a state machine plugin for my Order model and found that ttilley-aasm was a good fit for me. Here is how I installed it: RAILS_ROOT/config/environmet.rb config.gem ‘ttilley-aasm’, :source => ‘http://gems.github.com’, :lib => ‘aasm’ # rake gems:install # ./script/generate migration add_aasm_state_to_Order aasm_state:string # rake db:migrate And now how I test that it [...]

Continue reading »

Using JSVC with Tomcat on a 64-bits machine with a 32-bits JVM.

The Problem After a good amount of research and issues that  looked like memory leaks I’m moving my jvms to 32-bits JVMs for the servers that do not need a heap larger than 2GB. This was ok and a fast switch of the /usr/local/java symlink, BUT it was not as easy with JSVC that I [...]

Continue reading »

Journey with Thinking Sphinx and Crond

This is my journey through time Environment: Ruby => 1.8.7-72 Rails => 2.3.2 Thinking-sphinx => 1.1.3 I had a server running thinking-sphinx through crontab but noticed that this was not working so I started doing some debugging to see what was causing the non running thinking-sphinx:index task… First I Changed crontab to have full path [...]

Continue reading »

Follow

Get every new post delivered to your Inbox.