Is this your first visit? You may want to subscribe to the feed.

Articles tagged with github.comcollectiveideaacts_as_audited

Things that will rock the (my) world in 2010

Here are a few things that I’m really looking forward to using and abusing this year:

MongoDB

We’ve all been trying to shoehorn our Web 2.x applications into a 20 year old technology with an antiquated query language. If you haven’t looked into MongoDB, you need to, and you also need to check out MongoMapper.

I went out on a limb back in October and stated that a year from now, we’ll be using MongoDB for most new web apps. I think Mongo will be one of those things like Git that catches on like wildfire.

I have worked on a couple apps now with MongoDB, and it is a lot of fun. It blows my mind just how much our understanding of data modeling is tied to relational databases.

Sammy

Sammy is an awesome little Javascript framework for building RESTful and evented web applications. I’ve only build one little toy app with it so far, but I really enjoyed it and plan to update a couple existing apps an use it on some new ones this year.

Sunspot

If you need to do full-text searching, then Sunspot is your man. I have tried and given up on almost every single solution for doing real full-text searching in applications. I have a reputation around the office for enthusiastically touting several different search solutions as “the one”, only to watch all of them fall on their face in production.

But Sunspot has not let me down yet, and I have one app that has been using it in production for a few months with zero problems. I look forward to abusing it this year.

Rails 3

Two weeks ago, Rails 3 would not have made it on this list. In fact, it would have probably made it on my “things that are totally going to suck” list. I was afraid I was becoming a curmudgeon.

But the Rails core team has kicked it into high gear the past couple weeks. I spent some time playing with Rails (setting up a new app was no easy feat, although now there’s a guide) and digging through the internals and I can now say that I am officially excited.

What are you looking forward to?

Code: collectiveidea Jan 04, 2010 ● updated Jan 04, 2010 5 comments

acts_as_audited and authlogic

For those using authlogic that have had issues with auditing your User model, version 1.0.2 of acts_as_audited should cure your woes.

All you need to do is exclude the last_request_at and perisable_token fields from being audited. We also excluded a few other fields that don’t need to be audited:

class User < ActiveRecord::Base
  acts_as_audited :except => [
    :crypted_password, 
    :persistence_token,
    :single_access_token,
    :perishable_token,
    :last_request_at,
  ]
end
Code: acts_as_audited, collectiveidea Oct 29, 2009 ● updated Oct 29, 2009 0 comments

Training: Advanced Rails, jQuery, and more

Last week we launched Idea Foundry, the latest edition of our awesome training. We announced several great classes, including Advanced Rails and jQuery.

Advanced Rails

Advanced_rails

May 2629Holland, Michigan

So you drank the koolaid, learned Ruby on Rails and built some awesome sites, now what? Join us for a survey of advanced topics that will take your Rails apps to the next level. Scaling, building and consuming web services, writing plugins, contributing to Rails and so much more. See the Advanced Rails page for more info, and stay tuned for a sneak peek of the topics.

jQuery

jQuery

May 1315Holland, Michigan

We’re excited to have Karl Swedberg, author of Learning jQuery and member of the jQuery project team, teaching a class on the ins-and-outs of jQuery. Karl’s an energetic teacher who knows jQuery better than almost anyone (he’s consistently one of the top posters on the jQuery mailing list). More Info

Other Classes

We’re also offering new installments of our popular Ruby on Rails and ExpressionEngine classes.

And we have one more awesome class that we’ll be announcing any day now. Stay tuned.

: collectiveidea Mar 31, 2009 ● updated Mar 31, 2009 0 comments

Give back to the community

In our latest client project, we make use of at least 20 open source projects, from our beloved Rails, to great testing frameworks like RSpec, to plugins like Paperclip, to server-side software like Passenger, and many more. While we are appreciative of the hard work that goes into creating those projects for the first 2 seconds after we find them, we often take these libraries for granted.

As a small development company, we need any advantage we can get. It is the vibrant open source ecosystem that gives us a competitive advantage against the big guns. And not only do we benefit from the work of the community, our clients get more sophisticated software that costs less. Everyone wins.

Every project we get paid to write makes extensive use of open source software. We try to do our part to contribute back to the community, but our contributions definitely aren’t worth what we get out of the community. So we’ve come up with an idea…

At Collective Idea, any time we use an open source library in a project, we’re going to make a $10 donation on behalf of our client to that project. For our client, the cost is small: a couple hundred dollars in exchange for thousands of dollars worth of savings and better software.

We encourage you to do the same.

Project Maintainers

If you maintain a project on GitHub, do yourself a favor and make it easier for us to donate. GitHub lets you add your PayPal account to the project so all we have to do is click a button.

Code: collectiveidea Jan 09, 2009 ● updated Jan 12, 2009 8 comments

awesome_nested_set: making nested sets cool

Yes, I’m making the assertion that preordered tree traversal is now cool. And I don’t mean just “pocket protector” cool, because it’s always been that, but now it’s “show your friends” cool.

For those that have no idea what I’m talking about, and don’t really care, but still want to be cool, skip to the next section. For all three of you that want to understand all the gory details, check out this MySQL DevZone article on managing hierarchical data.

What are you talking about?

I’m talking about putting hierarchical data into a relational database, and a plugin to make that easier. There are lots of reasons for trying to do this: organizational structures, genealogies, taxonomies, nested pages of a website, etc. It’s kinda like putting a square peg into a round hole, except that the square peg is made out of Play-Doh, so we can force it through the hole anyway, and we just have a little extra mess to deal with.

There were several Active Record plugins out there that tried to clean up the mess, but they were either buggy or incomplete.

We created awesome_nested_set to try to remedy that.

What makes this so awesome?

There’s a lot of things that makes this awesome, but my personal favorite is that awesome_nested_set makes use of Rails 2.1’s named_scope features1, so most of the nested set methods return a scope that works as a finder. You can call find methods on it or access other named scopes.

class Department < ActiveRecord::Base
  acts_as_nested_set
  named_scope :in_need_of_review, :lambda => {{
    :conditions => {:reviewed_at > 1.year.ago
  }}
end

chancellor = Department.create(:name => 'Chancellor')
aa = Department.create(:name => 'Academic Affairs').move_to_child_of(chancellor)
Department.create(:name => 'Admissions').move_to_child_of aa
Department.create(:name => 'Student Services',
  :reviewed_at => 3.months.ago).move_to_child_of aa

chancellor.descendants.in_need_of_review
rogue = chancellor.descendants.all(:conditions => 'manager_id IS NULL')

There’s lots more info in the README on GitHub, so check it out. Let us know if you have any suggestions or feedback.

  1. It also backports named_scope for those still on Rails 2.0
Code: collectiveidea Nov 17, 2008 ● updated Nov 17, 2008 3 comments

Rails Training: January 20–23 in San Antonio, TX

San Antonio, Texas

We’ve been providing highly-praised Ruby on Rails training all over the world, and now we’re bringing it to San Antonio, Texas. We will be offering hands-on Ruby on Rails training in downtown San Antonio on January 20-23, 2009.

I’ve never been to San Antonio, so I’m really exited for this class. Any recommendations for things to check out?

Code: collectiveidea Nov 12, 2008 ● updated Nov 12, 2008 3 comments

acts_as_audited in development

Thanks to metatribe, a huge annoyance in acts_as_audited is now fixed: it works in development mode. Due to it’s dependance on Rails’ cache sweepers, which are only enabled when caching is, acts_as_audited didn’t work in development mode.

metatribe has a crafty solution, which took me a few minutes to believe it would even work. So pull the latest version and happy auditing.

Code: acts_as_audited Oct 12, 2008 ● updated Oct 14, 2008 1 comment

Win a free week of Rails training

Want to learn Rails but can’t scrounge up the cash for training? You can win a free spot at either our Rails session starting next Monday, August 25, or to an advanced Rails session whenever it’s announced.

All you have to do is Complete this brief survey about our upcoming Advanced Rails session. We’ll be drawing a winner at 5:00 TOMORROW, August 19.

Also, we still have some spots available for our Rails session next week, so head on over to the Sessions site to check it out.

Code: collectiveidea Aug 18, 2008 ● updated Oct 14, 2008 1 comment

Fix for acts_as_audited and attr_accessible

The biggest complaint I get about acts_as_audited is finally fixed: if you want to use acts_as_audited on a model that uses attr_accessible, you can set the :protect option to false:

class User < ActiveRecord::Base
  acts_as_audited :protect => false
  attr_accessible :name
end

This will prevent acts_as_audited from using attr_protected, which would cause Active Record to raise an error in combination with attr_accessible.

Get the latest code from GitHub

Update: Timothy N. Jones had a good suggestion to automatically disable attr_protected if attr_accessible has already been called. I updated acts_as_audited, so now you only have to set :protect to false if you are declaring attr_accessible after you call acts_as_audited.

Code: acts_as_audited Aug 02, 2008 ● updated Oct 14, 2008 0 comments

Ruby on Rails Training: August 25-28

Collective Idea is hosting another Ruby on Rails training on August 25-28, 2008. Our training is a new take on training: it makes it actually enjoyable! If you’re new to the Ruby world, or just want to get deeper into Rails, check it out.

The last session was a blast. People flew in from Orange County, New York City and the Midwest. We had pizza and beer at the brewery, grilled on the beach, played frisbee and sand volleyball, and of course, learned Rails.

I’m really looking forward to this next one!

Code: collectiveidea Jul 03, 2008 ● updated Oct 16, 2008 0 comments

Last call for early-bird price on Rails Training

Just a quick note to remind you that May 31 is the last day of early-bird pricing for the Ruby on Rails training. After Saturday, the price will go up from $1195 to $1495. (Who couldn’t use an extra $300?)

If you’re going to be at RailsConf, find us and get a discount code that gives you the early-bird price until June 6. We look forward to seeing you!

Code: collectiveidea May 28, 2008 ● updated Oct 16, 2008 0 comments

Collective Idea welcomes Brian Ryckbost

Collective Idea would like to welcome Brian Ryckbost. Brian started as our first intern 9 months ago, and, even after putting up with crap from Daniel and me, joins us today as a full-time employee. Congratulations, Brian, on graduating from intern to employee; you were the best intern we ever had!

Code: collectiveidea May 19, 2008 ● updated Oct 14, 2008 1 comment

Announcing: Training by Collective Idea

Update: Daniel has a great post that explains the idea behind the training.

We’re really excited to announce Training by Collective Idea on June 23-26. Come spend 4 days in Holland, Michigan, learning Ruby and Rails. Whether you’re a Ruby newbie, or want to get better, this training is for you.

The training features hands-on training by people who know Rails inside and out, and have taught Ruby, Rails, and Rails deployment across the globe.

In your free time, you’ll get to explore Holland’s unique downtown, the fantastic sand dunes of Lake Michigan, or talk to other Rubyists over drinks.

Register today and save 20%. We look forward to seeing you!

Code: collectiveidea May 15, 2008 ● updated Oct 16, 2008 0 comments

Awesomeness: database backups

At Collective Idea, we have a plugin called awesomeness that is…well, awesome. It’s a collection of things that we use in almost every project that aren’t generic enough to go into individual plugins (although some things may have evolved enough to be worthy of plugin status).

A while ago, I blogged a little snippet for backing up your remote database. Well, that snippet as evolved quite a bit, into it’s own set of rake and Capistrano tasks.

First, the rake tasks. You Can easily create a new local backup:

$ rake db:backup:create

This creates a backups directory in your project, with a subdirectory for each backup based on the timestamp. A backup consists of the schema.rb file and then a fixture for each table to hold the data. Why fixtures? Good question. Because we wanted the backups to be database independent.

You can easily restore your local database to the latest backup, or a specific version:

$ rake db:backup:restore VERSION=20080427214315

That’s nice, but what good are local backups? That’s where Capistrano comes in. Just add this to your config/deploy.rb:

load 'awesomeness/backup'

This adds some nifty remote backup support. Now, whenever cap deploy:migrations is run, a backup of your remote database will automagically be created and stored in the shared directory on the server. You can also have them transferred to your local machine by adding a callback in your deploy.rb:

after "backup:create", "backup:download"

Sometimes, you just want to take a snapshot of the server and plop it into your local database.

$ cap backup:mirror

How do I get this backup awesomeness?

Awesomeness now lives on Github (like the rest of the world). Fork it and let us know what you think.

Code: collectiveidea Apr 27, 2008 ● updated Oct 14, 2008 2 comments

Tips for freelancers: take a shower

While we’re not exactly freelancers at Collective Idea, we operate very much like freelancers; we are contractors that work mostly out of our homes on client projects. We share many of the benefits that freelancers enjoy, and experience many of the same challenges. In the coming days and maybe weeks, I will try to post some of the things I’ve found helpful from personal experience.


Seriously, take a shower, every day! Not only that, but take a shower first thing in the morning.

Working from home, it’s easy to get into the habit of stumbling out of bed, occasionally making a quick pass through the kitchen, and plopping down right at your desk. There were often days weeks where I would go straight from bed to my office and start working, not pausing to shower until mid-morning, noon, or sometimes even after work.

I’ve found that showering early in the morning has been helpful for several reasons:

  1. Consistency: We are creatures of habit, and that is a good thing. We live in natural rhythms, and the beats that we move to are important for productivity. I’ll talk more about this in my next post.
  2. Transition: When I first started working from home, what I missed the most was the drive or walk from home to work, and back again. Without it, I found it very difficult to make the mental transition from personal life to professional life. The two would often blur and I would spend the first half of my day distracted by personal matters while I was consumed by work in the evenings. Showering has become my morning transition. I take care of personal matters when I wake up–breakfast, bills, laundry, etc–and begin working immediately after I shower and get dressed.
  3. Freshness: water is very refreshing, both physically and mentally. While I’m not one of them, many people find that they do their most creative thinking in the shower. But I do find that after I shower I’m very refreshed and sharp.

So there you have it: proper hygiene is as important for your professional life as it is for your personal life.

Up next: you’re a professional, show it with your hours.


This post is somewhat different from the typical format of this blog, so I’d love to hear your feedback. Also, I’m interested in any tips you may have as a freelancer or independent consultant. Send me an email or post your tips in the comments.

: collectiveidea Mar 20, 2008 ● updated Mar 20, 2008 7 comments

Subscribe

Browse by Tag

Browse by Tag

Browse by Tag