hey, what is the opposite of the h helper in Rails?
— #rubyonrails
hi there. I’m still quite new to ruby RoR, but I’m trying to write a RoR task that validates migration files (makes sure down part inverts up part correctly and vice versa). Anybody have an idea about how to get started. I’ve been readings all kinds of ruby documentation RoR source code and I guess I would just parse each migration file one by one and do the check. How would you do it?
— #rubyonrails
class TaskReference < ActiveRecord::Base
  def destroy
    # make sure we do not try to destroy non-existing references
    super if TaskReference.exists? self
  end
end

It's a Load Alright

class MoveCustomersToStopThru < ActiveRecord::Migration
  def self.up
    Load.class_eval do
      has_and_belongs_to_many :customers
    end

    add_column :loads, :customer_id, :integer
    add_column :loads, :stop_thru_id, :integer

    Load.all.each do |load|
      cs = load.customers
      load.customer = cs[0]
      load.stop_thru = cs[1]
      load.save
    end

    change_column :loads, :customer_id, :integer, :null => false
    drop_table :customers_loads
  end

  def self.down
  end
end

so it's a plugin, like flash?

  • RORgasm: guys is there a nice plugin i can use to have sortable ajax tables for my index view?
  • danabrit: not that i know of.
  • lifo: it's called javascript
  • toretore: is that a gem?
  • lifo: nop. it comes with the browser
  • lifo: i think
  • RORgasm: what r u guys talking about?
  • toretore: so it's a plugin, like flash?
  • lifo: kinda, yeah
All i see and have read is Demanding for this support.
But your dead slow blog updates & info will kill us before Merb 1.1
rails still isn’t a good role model for good, idiomatic ruby code.
— the usual rails-hating bullshitters in #ruby-lang
I wonder if I have to spend time to learn RoR
— #rubyonrails
Got a WTF you want to report? Email us.