Rails developers aren’t exactly known for getting their indexes right (or even at all) on their databases. Granted, databases are a tough subject, and some people and companies make their living dealing with only databases, and some only with one database (like MySQL or Oracle). If you coming to web development with no formal background in databases, and it’s all new to you, then it’s totally understandable to maybe forget about indexes initia...
Verbose Logging
software development with some really amazing hairGetting rid of transactions for the poor man
A quick post for today. Want to get rid of transactions from ActiveRecord for something? Here’s a cheap way to do it. It only works for MySQL obviously, but you can roll your own if you are on postgres. I’ll make it a bit less crappy and make it a gem or something.
Read the full article
My Watch List, Into 2010
Lots of interesting things are afoot, and I try to keep track of them. Here’s what I’m watching. Rails 3 Lots of new changes are coming with Rails 3, and it’s pretty exciting. I wrote about some of the cool ones here. Rails is shaping up to be faster, more modular, and generally better and easier to work with. With all the smart people working on it, you don’t have to look very hard to realize this is going to be a big release, and is only goi...
Read the full article
Rails 3 release notes: What does it mean to you?
The Rails 3 Beta got dropped a few days ago, and the release notes for Rails were put out a bit before that. The list of changes is long; this is a big release. There’s a lot to sift through, a lot to change to upgrade your existing application, and a lot to learn whether you are upgrading or starting a new app. The big question is: WTF does all this mean to me? Don’t worry, I’m going to tell you. If you want to read the full release notes, go...
Read the full article
respond_to with respond_glue: override respond_to
So check this: you have a nice little Rails app. You have some stuff for a JSON API type system. You’ve got an STI setup with the Widget model class and the more concrete FancyWidget and WeirdWidget classes. You’ve got a WidgetsController, and the corresponding FancyWidgetsController and WeirdWidgetsController Yay. It works. You can deal with both types of Widgets using JSON. Now you need an HTML interface to it. Fine, you can just throw in a ...
Read the full article
role_on: Really Simple Roles (for Rails)
I looked at a few role systems for Rails, but never found what I wanted. They were all object based systems, never just “allow a user with this role to do this action”. Either that or I never found the systems that did that, or totally missed the docs on how to configure those systems to do what I wanted. Well, actually acl9 seemed to do that, but whatever. So I made role_on The instructions are on Github, so I won’t repeat them here, but it’s...
Read the full article
Useful links of the evening
Ruby on Rails content_for Project: Builder RSS pauldix-feedzirra Basic Rails association cardinality Nested Object Form with has_one Relation
Read the full article
Debugging cucumber on rails
I like frameworks, but sometimes debugging them is more entertaining. I don’t know why I didn’t think of this method before, but mischa on github has a great little repo showing how you can do it. The README Usage: Add: require ‘ruby-debug’ require ‘cucumber_rails_debug/steps’ To features/support/env.rb Then use: Then debug # opens the debugger or Then what #prints out params, url and html Check it out here
Read the full article
Riding rails with selenium
Selenium is a suite of tools to automate web app testing across many platforms. Cucumber is a BDD framework that allows you to write things in English (or whatever language you want, really), and have that execute as code. Put those together with webrat and rspec and you have a pretty mean stack to test your ruby on rails web application with. Sort of. I’ve been having some problems with it, getting it set up, but it’s coming along. This isn’t...
Read the full article