Today I was faced with an interesting dilemma, how does one programmatically define migrations into a plugin so you can essentially “plug-n-play”. I did a little bit of research into Rails Engines, and I wasn’t too terribly excited about the notion of having a dependency for such a small plugin, if this were something more integrated…I’d probably use it, but for this, I really only need to have these migrations run once you’ve installed the plugin, and be on my way.

So, I decided to do a little bit of research on the ActiveRecord::Migrator class to see how I could approach programmatically executing the migration outside of the standard rake task, so I could build my own custom migration rake task for my plugin.

It turns out, there are a bunch of functions you can utilize to build your own custom migration tasks for your plugin, that I wasn’t immediately aware of. Here is how I did it:

namespace :myplugin do
  desc "migrates my plugin's migration files into the database."
  task :migrate => :environment do
      ActiveRecord::Migrator.migrate(File.expand_path(File.dirname(__FILE__) + "/../db/migrate"))
      Rake::Task["db:schema:dump"].invoke if ActiveRecord::Base.schema_format == :ruby
  end
end

I simply saved that block of code into my plugin’s /tasks folder and named it custom_migration.rake. Next, I went to the root of my application and ran rake myplugin:migrate, and huzzah! it worked!

Nothing too amazing, and I actually based this entirely on the vanilla db:migrate function. The first line of the task essentially tells the ActiveRecord Migrator to search through my plugin’s db/migrate folder for any migration files it can find, and then brings all of them up! It would be nice if the vanilla db:migrate supported a MIGRATIONS_PATH constant so we could just use the same mechanics and build on top of them, rather than essentially re-write them just to do this.

OR better yet, wouldn’t it be nice if rails db:migrate actually scanned our plugins directory for migration files as well? That sounds like the best option to me.

Now, I am not sure if this is “the ruby way” to handle this problem, and as I stated earlier, Rails Engines is probably the way to go if you have a much larger plugin you are designing, but for me, this seemed to work just fine.

Limitations

There are some limitations to that custom task. For instance, if you were to run db:rollback, it would not be aware of the migration files that I have previously run that live within my plugin, you’d have to build another custom task to manage revoking the migrations you installed. Also, if they end up changing the way you actually migrate migrations, you might be screwed. But, alas, here is hoping for that MIGRATIONS_PATH constant!

December 8th, 2008, I will be attending a 1 day course lecture and workshop on “Presenting Data and Information” by Edward Tufte. If you don’t know a lot about Edward Tufte, he has written a series of fascinating books on unique and interesting ways to visualize and present data. The fee for the workshop is only $380 and includes a copy of 4 of his greatest books. He will be covering the following topics in his course:

  • fundamental strategies of analytical design
  • evaluating evidence used in presentations
  • statistical data: tables, graphics, and semi-graphics
  • business, scientific, research, and financial presentations
  • complexity and clarity
  • effective presentations: on paper and in person
  • interface design
  • use of PowerPoint, video, overheads, and handouts
  • multi-media, internet, and websites
  • credibility of presentations animation and scientific visualizations
  • many practical examples

It should definitely be a day of fascinating study, and I encourage anyone who is invovled in user interface design and/or user experience design to sign up for one of his courses.

Ask yourself, why are we still supporting Internet Explorer 6? Not as developers, but as people who use the Internet. If you are a web developer, you are one of the first people who will scream “I F#$@ this browser!”

So I ask the question, why are we still supporting this browser, 7 years later?

Everyone who is still using IE6 does so because we allow them to. We still add “degraded” support for the browser, we still make alternate stylesheets, we still make a ton of hacks that only work for the redheaded step browser. I dare you, tell me one time you said the word “happy” and “IE6″ in the same sentence! Enough is enough.

The Line in the Sand

I am proposing we set a day to “turn off the lights” for IE6. Much like our government has decided that on a specific day, over-the-air analog broadcasting will go away. Why not do the same? That glorious day, everyone who supports the “lights out” concept, will actively limit IE6 users from accessing their sites and applications. Now, I am not saying lets just let things degrade and look unprofessional, I am saying turn it off completely. Its a rash move right? Does that potential user base you are shutting out scare you? Not really. It doesn’t scare me. Take a look at the global statistics for its use, we are talking about a very small minority of people. But it is still enough to count, and for some reason we still support this aged code.

How can we ever hope to as a community of engineers hope to better ourselves and the things people are using if we have to worry about this sort of legacy. There is nothing beautiful about what it takes to support even the simplest of CSS techniques in IE6, and it just doesn’t make sense for us to keep wasting important dollars on it.

Now, the irrational part of me says, as soon as I hit publish, I am going to block IE6 traffic from ever viewing my blog again. But lets face it, that is not a solution that is going to help people understand the reasons they need to move, nor is it going to make you as a person look very wise. I want to set a date far in advance for existing websites, and for all new and upcoming websites and services, already have it off. Lets say, 10 months from now? That gives us a long time to be able to warn and let people know that they need to upgrade or move to a different browser. I mean hell, by the time that 10 months is up, we should be seeing IE8 in the wild, isn’t that a good enough reason?

Ramifications

Okay, lets be more realistic, the only people who are really stuck with IE6 are the people suffering in cubicles run by IT departments that are either lazy, stuck with legacy issues, or just uneducated about the real reasons to upgrade their company.

Well to that I say, too bad. You have had 7 years to decide what to do about this problem, and I think its unfair for developers to have to pay the price. Why should be have to bastardize our software, and invest a large sum of our time and money into something that has not even been updated since 2004?

I am definitely impressed by companies like 37signals and Apple who are putting their foots down when it comes to their products. Don’t think of it as an exclusive, elitist club, but a very important reason to educate and explain to people (well in advance) why it actually hurts their experience of the web today to be stuck in the past. Going forward our company is going to be following this mantra, educate and upgrade. I am entering a market demographic that will most likely be stale and out of date, but I still say its unacceptable, we as the developers need to help people understand.

Am I crazy? How do you feel about it.

I am going to avoid using the word “stealth mode” for my startup and our product. Whenever I hear someone say their product is in “stealth mode” I interpret that as “I don’t have anything worth showing to anyone, therefore I pretend its more important….mode”. If you are involved in my extended network, you know what I have been doing, roughly. I have not been afraid to brainstorm and discuss this product with people I know and respect because that is how great products are born.

November marks an entire year of incorporated business for my company, Panoctagon. It has been an absolutely amazing ride, I wouldn’t trade any of the past experiences I’ve had for the world. I have worked with a lot of extremely talented people, I have learned and done a lot of things that have nothing to do with software engineering (which has been a lot of fun), and I can say we survived the first year.

We spent a lot of time honing our skills as a group, defining some pragmatic approaches to not only software but our business practices, and have become a pretty efficient group. I am happy about this.

So, what have we been doing? Today I am proud to announce the launch of our first software product, Happening. We have not officially released it into the wild yet, its still got some rough edges and polish that needs to be applied, but its nearly there. Happening is an event management and publishing solution for education. What do I mean by that? Technology in education often is crap. Talk to people who use it, they never have anything good to say about their tools. Ridiculous overhead, costs way too much, and requires a lot of hands on training.

We decided to build an affordable, easy to use, hosted service that attacks the age old problem of managing and communicating events for schools; event calendaring, if you will.

Happening is more than that, though. There are two very important markets for us, the first is the administrative people inside the institutions who have to do all the monotonous data entry, using the advances in technology that we in the consumer web take for granted, we hope to provide an unparalleled experience that is robust and intuitive. Might I also add, you won’t be needing weeks of training, that is our #1 goal. I spoke with a few different schools we are working with on this project and they all pretty much responded “how much training will you be offering us”, and I responded “I a product that hasn’t even been completed yet, is going to have a huge learning curve and weeks of training attached to it, we’ve failed”, and that has been our mantra, from day one.

Happening is not just about the administrators though, its also about the parents and students, and redefining how they interact with the event information that they care about. Happening is going to change the way parents and students consume event information through their schools, and I am excited to see how things changes things for them.

Lastly, I have to ask this, If you know someone who works for a school who might be interested in a service like ours, please feel free to contact me or forward me information to contact them. We are very excited about what we’ve been up to and want to get schools just as excited.

Also, I’d like to thank my team, our advisory board, and my family and friends for their continous support and advice. We would not have made it this far without you all, and I hope we can make this into something great for education.

Flashback, it definitely seems more cultish now, right?

Normally, I stay the fuck out of conversations about politics in the public. But this is just too good to pass up. Mostly because most of the reasons that McCain supporters are happy about Palin are many of the things they’ve previously critisied in their opposing party.

Jon Stewart, take it away.

Comments are so turned off, I don’t want to even bother.

Heck of a speech though, eh? :)