Entries Categorized as 'Ruby/Rails'
December 7, 2007
I upgraded to Rails 2.0 today, and found that countercache columns were suddenly :readonly, which means that you can’t update them with your regular old model.associationcount = model.association.count routine. So, I whipped up the following ActiveRecord patch.
module TagTeamInteractive
module ActiveRecordSynchCounters
[…]
Posted in Ruby/Rails
1 Comment »
May 2, 2007
Yesterday, I discovered RubyInline. In short, it’s a gem that allows you to write Ruby extensions in C.
I decided to see what I could do with it.
Posted in Ruby/Rails, Software Development, Hacks
No Comments »
May 1, 2007
My first Rails plugin is working! I won’t quite say finished, as it includes no formal tests or migrations, but I’ll get that packaged up in due time.
I recently found myself wanting to move my MySQL database from MyISAM tables to InnoDB tables. The primary reasons for this are:
InnoDB supports transactions
InnoDB supports row-level locking, as […]
Posted in Ruby/Rails, Software Development
17 Comments »
April 24, 2007
One of the annoying things about Rails is that it goes so far to connect pieces of the database together for you, but it doesn’t have the ability to automatically do validations or associations based on the schema data. A VARCHAR(30) NOT NULL is always going to need validates_length_of(:field, :in => 0..30), and validates_presence_of(:field), right? […]
Posted in Ruby/Rails
No Comments »
April 24, 2007
RJS is a great little tool for interactively updating pieces of a page in response to some AJAX action, but it tends to fall short when you want to do anything beyond blinding dumping content into a page. Dan Webb has written a plugin called “MinusR” that basically flips RJS templates on their head. Instead […]
Posted in Ruby/Rails, Javascript/AJAX
No Comments »
April 22, 2007
Rails has the really nice ability to store an AR model object in the session for easy access. Additionally, it obeys the following rules:
If obj.new_record? == true, then any associations on the object will be saved in the session as well.
If obj.new_record? == false, then any associations whether association.new_record? == true […]
Posted in Uncategorized, Ruby/Rails, Software Development
No Comments »
April 12, 2007
See the Prototype announcement and the
Scriptaculous announcement for more info and changelogs.
In short, it’s a lot faster, memory leaks are fixed, and there are a number of new features including sound support (which I don’t think I’d use, but which is still cool). I tried it out tonight in my personal work, and the […]
Posted in Ruby/Rails, Software Development, Javascript/AJAX
No Comments »
April 6, 2007
I’ve managed to get FastCGI running through Apache, and will be testing its performance in the context of Rails in the next few weeks. I haven’t done any formal testing, but it feels faster than my current Apache ProxyLoadBalancer -> Mongrel setup.
Posted in Ruby/Rails, Apache
No Comments »