Rails, Mongoid & Unicorn config for Heroku

You dont actually need to do this, so for people coming to view this question see: http://mongoid.org/en/mongoid/docs/rails.html “Unicorn and Passenger When using Unicorn or Passenger, each time a child process is forked when using app preloading or smart spawning, Mongoid will automatically reconnect to the master database. If you are doing this in your application … Read more

minitest, test::unit, and rails

There is a Test::Unit “compatibility” module that comes with Minitest, so that you can (presumably) use your existing Test::Unit tests as-is. This is probably the Test::Unit module you are seeing. As of rails 3.2.3, generator-created tests include rails/test_help which includes test/unit. The test “something” do syntax is a rails extension. It’s defined in ActiveSupport::Testing::Declarative, which … Read more

How to implement a RESTful resource for a state machine or finite automata

The update action (PUT method) is not appropriate because PUT is suppose to be idempotent. The only this would be possible is if the state was sent as part of the representation. This is inconsistet with an “event”. Is this correct? Correct. Since, events aren’t idempotent, then the a POST must be used. But, to … Read more

Best practices for new Rails deployments on Linux?

I switched from Mongrel Cluster to Passenger two weeks ago (Debian Linux Server). I didn’t look back for a second. Passenger is probably the easiest way to get your new server up and running. Performance and reliability are reasonable too. Personally, I like to spend my time working on exciting new Rails projects rather than … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)