Practicing Code with the DevChix

August 22nd, 2010 by comment

In February I finally decided to do something I always wanted to do with DevChix. I wanted to lead a group project intended for those who wanted to learn and could commit to 2 hours a week. I had 3 volunteers.. then two.. and then one! But thats ok, I know people get busy and other things going on, so no big deal. But cool thing is, even those that left said they learned something. So, my goal was still reached!

The Project

I had this idea in my head for awhile. One thing with lists is, you need to write down something if you want to do it today. We all have todo lists, and there are somethings we want to do every day. You may try to remember them without a list, or maybe you write them out. I thought it would be cool to have a todo list app that will give your list, allow you to check them off, then next day you have the same list. Bonus to have a graph of how many you did each day of the week. I think its motivating to see a graph of my progress.

Getting Started

Its my experience, when I start an app, I add user login and I get hung up on the authentication, tests and stuff and never get to the meat of the app. So I wrote a simple login system with just a username (no password), threw it in the session and wrote some simple methods to check to see if logged in. Later we replaced it with Devise with not much trouble at all.

What we learned

  • git, making branches, push and pull
  • erb and haml
  • grid 960
  • HighCharts a javascript graphing library
    devise, we added a whitelist so we can have a beta with only certain email addresses allowed to sign up.

  • publishing with heroku
  • rails of course

Challenges

Summer got busy, including a cross country move for me and new job! We still managed to meet about every 2 weeks. We used github for our code. We put our tasks in Pivotal Tracker and that worked fine. We used Github wiki to record meeting notes, what happened since last meeting and who is doing what for the next week. We’ve been able to meet weekly the past month or so as the summer is winding down.

Whats next?

We are deploying the app to DevChix for beta testing. From there, not sure.

ˆ Back to top

Book Review: "Refactoring in Ruby"

January 4th, 2010 by comment

“Refactoring in Ruby” written by William C. Wake and Kevin Rutherford.
Published by Addison-Wesley

This is more like a “workbook” then a “how to write awesome code” book. You can download the code from github http://github.com/kevinrutherford/rrwb-code and you will find tests/specs for the exercises.

The book is arranged in three parts, The Art of Refactoring, Code Smells, and Programs to Refactor.

There are explanations of “code smells” which are one characteristic of code that could be improved. Some of them are long parameter lists, unnecessarily complex, global variable, feature envy sections, etc. One thing I find interesting is the “How did it get this way?” section. It gives some insight into the thought process and reasoning behind the smell. I think this is good, as programmers our ego may be rather miffed to hear “This code stinks” but with some reasoning, it makes the pain less and I think firms up in our minds when this happens again, to do it this other way. I always want to know why when someone says I could do such and such thing better.

In addition to the code smell examples there are three programs to refactor in the end of the book. In a conversational tone, it walks through and gives some hints on what needs refactoring. Its almost as if you had a pair programming buddy working with you and identifying in small chunks what can be improved. This is definitely something I want to work through more carefully.

What I find odd, is that not all the code smells have code examples. The inspiration for the book I think is the Martin Fowler book “Refactoring Improving the design of Existing Code” which has examples for every code smell. Maybe Ruby smells less than Java? Or those fixes are really trivial? I don’t know. Overall, this is a great book and is certainly worth the price and investment and you will be a better programmer because of it!

ˆ Back to top

How rails has changed how I seek for a job

December 10th, 2009 by comment

For nine years, I have developed for the web. Over the years I’ve programmed in C, C++, Python, Java, ASP, PHP, Perl, and most recently, Ruby.
Since my first job as a developer, I’ve never looked for a new job: all of my job transitions have come through friends or co-workers.

In mid 2007 I was happy working with Perl. One day a friend told me about a Ruby on Rails job. Back in 2007, Rails developers in Brazil were rare. Because of that, the employer was seeking someone who fit the company instead of someone with Rails experience. That was great for me!

After a pleasant summer, the new job’s charm wore off and I decided that I wanted to move on but continue to program with Rails. Finally, I left my job.

When I started to send out resumes I soon realized that Rails’ culture fundamentally changed the way that a Rails job search functioned. In addition to the traditional resume or CV, Rails jobs demanded to know about Working With Rails, LinkedIn, GitHub, Twitter, personal blogs and sites, discussion forum posts, participation in open source projects, and a multitude of other online presences. These new demands made me realize that I hadn’t been cultivating a comprehensive web presence, which is not uncommon for female programmers, in my experience.

At first, this realization was disturbing. Though it’s still possible to get a Rails job without a vast web presence, I was upset to realize that I hadn’t been adhering to this best practice. It was particularly jarring the first time I was unable to answer these questions to potential employer.
The practice of software development as a craft is constantly reinventing itself and this includes the processes around job seeking and reputation building. Despite all of the hours, projects, languages, and jobs I’ve previously invested in, I now realize that I need to adapt to this new developer reality of being social and visible with my work in order to win back my standing as a desirable developer and potential candidate for a Rails position. The details of how I’ll implement that strategy will be the subject of an upcoming post, but I look forward to the possibilities ahead.

To read in portuguese.

ˆ Back to top

RailsBridge

May 4th, 2009 by comment

Even though I am a Python developer, this made me happy:

http://railsbridge.org/

We’ve been fortunate to have an outstanding, welcoming Python community driving the tone and the quality of events from PyCon, down to the statewide and local user groups. We don’t yet have a need for such a bridge group, and I hope we never need one. But it’s great to see one form quickly where it’s needed, and to see familiar names associated with it. More power to you.

Gloria

ˆ Back to top

Hpricot and woot!

January 13th, 2009 by comment

I know there are several sites for tracking wootoffs on Woot, but I wanted to write my own small program in Ruby. To do this, I used Hpricot by why the lucky stiff.

First, I need my require statements. I’ll need rubygems, since hpricot is a gem, and open-uri to access woot.

require 'rubygems'
require 'hpricot'
require 'open-uri'

Woot has an API that returns XML, so I used Hpricot::XML to parse what comes back.

doc = Hpricot::XML(open("http://www.woot.com/salerss.aspx"))

Now I want to know if it’s a wootoff. If it is, I’ll want to check more frequently. I use the at method to find the element I want, and inner_html to get the text inside that element. The element I’m interested in is woot:wootoff. I’m going to start putting the output into the text variable.

wootoff = doc.at("woot:wootoff").inner_html =~ /true/i
text = wootoff ? "wootoff! ^_^" : "no wootoff v_v"
text << "\n"

Next I want to know what the item is and the price and shipping.

text << doc.at("item > title").inner_html << "\n"
text << doc.at("woot:price").inner_html << " + "
text << doc.at("woot:shipping").inner_html << "\n"

I'll also want to know how much of the item is left, so I know if I need to rush to buy something I want.

percent_gone = doc.at("woot:soldoutpercentage").inner_html
percent_gone = percent_gone.to_f * 100
percent_left = (100 - percent_gone).round
text << "#{percent_left}% Left"

I took all that code and put it into a method, to be looped over every two minutes. I wanted it to print to the screen only if the text changed. This is what the completed program looks like.

#!/usr/bin/ruby
require 'rubygems'
require 'hpricot'
require 'open-uri'

def woot_item
  doc = Hpricot::XML(open("http://www.woot.com/salerss.aspx"))
  wootoff = doc.at("woot:wootoff").inner_html =~ /true/i
  text = wootoff ? "wootoff! ^_^" : "no wootoff v_v"
  text << "\n"
  text << doc.at("item > title").inner_html << "\n"
  text << doc.at("woot:price").inner_html << " + "
  text << doc.at("woot:shipping").inner_html << "\n"
  percent_gone = doc.at("woot:soldoutpercentage").inner_html
  percent_gone = percent_gone.to_f * 100
  percent_left = (100 - percent_gone).round
  text << "#{percent_left}% Left"
end

woot_text = ''
while true
  new_woot_text = woot_item
  if woot_text != new_woot_text
    woot_text = new_woot_text
    puts "*****************************************************"
    puts woot_text
  end
  sleep 120
end

Here is some output from the program.

*****************************************************
no wootoff v_v
Lockjaw Self-Adjusting Locking Pliers - 2 Pack
$9.99 + $5 shipping
100% Left

Of course, this is only a beginning to what you can do. You can have it send a twitter, SMS, email, or any number of things if an item you want is available or a wootoff starts.

Angel

ˆ Back to top

How to see exception_notification plugin work in development mode.

December 9th, 2008 by comment

I use HopToad by the Thoughtbot Guys (I say guys because I know they don’t have any girls on the team *wink*) to handle exceptions from my rails apps these days but today I found myself in a situation where I needed to use the exception_notification plugin instead. I haven’t used the plugin for quite sometime so I wanted to make sure I had everything all setup correctly before pushing out to staging and production. I remembered that I had done this before in development but I couldn’t remember everything I needed to do so I, of course, asked uncle Google. After reading the readme and a little googling I figured out what I needed to do in order to see it work in development. It took me far longer than I wanted and I don’t want to go through that again in the future so I figured I would just write a quick blog post to remind me next time I want to do it.

So here goes:

First get Exception notification all setup (this is all from the readme file)

script/plugin install git://github.com/rails/exception_notification.git

then in application.rb put
include ExceptionNotifiable

then in environment.rb put
ExceptionNotifier.exception_recipients = %w(joe@schmoe.com bill@schmoe.com)

Once you have it setup you can do all the other stuff that lets you see it work in your development environment.

put the following two lines in your application.rb file
alias :rescue_action_locally :rescue_action_in_public
local_addresses.clear

then in your development.rb file change
config.action_controller.consider_all_requests_local = true
to be
config.action_controller.consider_all_requests_local = false

Exception Notifier doesn’t send email notification on ActiveRecord::RecordNotFound and ActionController::UnknownAction errors. So you will need to create 500 error to see the notification going out in your log. You can just add an action to a controller that throws a divide by zero error, restart your server and hit that action and you should see the notification trigger in your development log.

Once you have seen it work make sure to undo everything in the second section.

Cheers

ˆ Back to top

Rails Summit Latin America

October 16th, 2008 by comment

I am currently in Sao Paulo, Brazil at Rails Summit Latin America and the experience has been great thus far.

Ladies at the conference there is information at the end of this writeup about how to join. If you don’t feel like reading everything in this writeup that is fine but please do read about joining.

In contrast to many conferences I have been to recently I have been to just about every talk at this conference and I have thoroughly enjoyed them all. I say just about because there is a second track that is going on in another room but I haven’t been to those sessions.

The Organizers:
Fabio Akita and Gilberto Mautner Founder of locaweb have done a great job with the conference and I would like to give them a special thanks. The lineup, venue and everything has been great. Obrigado!

Theme:
I think most conferences, through the keynotes, some how seem to create a theme. The theme that I am picking up on at this conference is this: “Have No Fear” and “Just Do It”. No one actually said either of those two things but thats basically what I am taking away from most of the keynotes. They have all been especially encouraging for people to become involved. Contribute, create, and code. Give back to the community and get involved. Don’t be afraid .. put yourself out there and learn from the feedback you get.. learn from the experiences of creating.. do side projects.. basically be PASSIONATE.

The Talks:
All the talks I have seen have been excellent. I give them an excellent rating because they have all had the qualities I look for in a talk.
1. The content is good and interesting.
2. The delivery of that content is entertaining or at least engaging.

Chad Fowler – I really enjoyed Chad’s talk and as I sit here I am struggling to figure out a way to describe his talk and actually do it justice. He spoke about his background in music and how that has translated to his life as a developer. In addition, he spoke about being remarkable. He talked about many ways in which people are remarkable and many ways in which we ourselves can become remarkable people. He touched on many things and did so in such a way that I was able to stay engaged with him. There were pictures and video’s and graphs and fake numbers and.. anyway about the best I can say is that I personally really enjoyed his talk.

Dr. Nic Williams – Dr. Nic’s presentation is a little easier to sum up but at the same time I can’t really do it justice. Dr. Nic is one of those speakers that if you ever have a chance to see him speak you should definitely take the opportunity. He is hilarious and has a good message. His talk was all about how to contribute back.. how to get involved.. how to participate. Make the future you proud of the you now. Dr. Nic also talked about newgem

Chris Wanstrath – Chris’s keynote started off being about the future of Ruby and RoR but in the end he took it back to the past and where we have come from. He went through a great deal of history on how we got here which I personally enjoyed especially when he pointed out the first ENAIC programmers were all women, unfortunately he was speaking quite fast so I think a lot of his talk was lost in translation. I think the primary thing Chris was trying to get across is to not be afraid. If you have an idea.. make time to get to it you never know where thats going to go. In the very least you gain experience and you gain knowledge. Chris has had many projects in the past but his current claim to fame is all about github.

Jay Fields – Jay’s talk was about the immaturity of testing as a whole. While I agree with some of the things he said I also disagree with some of the things he said. I have had the luxury of getting to pair with Jay on projects before and its always interesting for me to see him speak because I have first hand experience with a lot of things he talks about. He described the problem of immaturity in testing as a whole first with the fact that we can’t even agree on common terminology. He then proceeded to talk about various tools and the pros and cons of each. He covered Selenium, Test:Unit, Rspec, Syntasis, and Expectations. The last two being the most immature of them all and bleeding edge. i.e. use at your own risk. He also answered a few questions about how to make your test suite fun faster and his response was basically that if you are willing to deal with the pain that goes along with it there are tools you can look into using such as null_db, unit_record, and ARBS. You can read about them on the null_db page on Agile Web Development site. That page links out to the other plugins. Jay also pointed out that all the things he was talking about are from his point of view. In other words its the context in which he works that causes him to have some of the testing beliefs he has.

David Chemlisky – David’s first talk was about doing TDD and in my opinion he did an excellent job of demonstrating TDD. I have seen him give a talk similar in the past and of all the people I have heard try to describe TDD, David is one of the most skilled at it. He gave the talk from the point of view of a teacher which in my opinion is really the only way you can truly explain TDD. He went through the process step by step with us all to show us the way. :)

His second talk was more about Acceptance testing and story runner and the newest version of story runner which is being called cucumber. He demonstrated how it worked and made sure to give context around all the terminology such as user stories etc. Hopefully there will be some way of seeing this talk again maybe through a screen cast or something of that nature. I’ll be sure to ask him if he would be willing to do that. Or maybe there is one with cucumber? Not sure haven’t had a chance to look yet.
Couple of links to stuff he talked about.
Cucumber
webrat on github and a blog post on it here

On that last note I am actually interested to know if these talks are being recorded and if they will be available somewhere? Anyone know the answer to that?

Obie Fernandez – I haven’t actually seen Obie give his talk yet but I have seen the talk (insider information) so I am going to go ahead and give a recap.. I asked him to plug DevChix and wanted to have this write up already done before he did so.. ;-) So Obie’s talk will be about the “Hashrocket Way”. He is basically giving up our secrets.. Like Dr. Nic said no secrets! His main focus will be around how we work, the fact that we follow Agile Tenants and that we value fun, collaboration, and effectiveness. We achieve those things through certain practices such as pair programming, TDD, Story Carding, launch parties etc. Again you should check out his blog.

Ninh Bui and Hongli Lai a.k.a The Phusion Guys – I woke up late so I didn’t catch all of the talk from the Phusion guys but the part that I did catch was hilariously funny and explained things like caching and database sharding. Additionally, they gave a demo of yuumis_comments.. and here is also a link to their blog

I call out all of these guys because they are some of the best speakers I have ever seen and I actually saw them speak at this particular event.

Phillippe Hanrigou – Phillippe is going to be giving a talk on how to effectively do acceptance testing which I am looking forward to but I won’t be able to cover that here because I haven’t seen it and since I don’t have insider info on that one I’ll just have to wait like everyone else. I do know that he will be talking about one tool I hadn’t heard of before called Deep Test. You should check Phillippe’s blog as well

Luis Lavena – Luis will also be giving a talk about surviving with RoR and Ruby as a windows user.. again I think the talk is going to be awesome but its in the future so I can’t really talk about that yet. You should check out his blog!

The Venue:
The venue is quite nice. The main auditorium is very well arranged and has plenty of room despite the fact that there are a lot of people here. There is a very large screen making it easy for everyone to see the slides as well as the speakers. The lighting on the actual speakers is a little weird but other than that the actual conference room is great. The audio is fantastic and the actual hang out area is quite nice as well (other than the lack of air conditioning but thats just me being a little whiny its not really that hot). One other really important point that I want to bring up is the translators. You can get a headset at the checkin area that will translate the talks from English to Spanish and Portuguese and from what I understand the translators have been doing a kick ass job so a special thanks to all those ladies in the booths translating for us.

The Community:
I was very encouraged by the number of people at the conference, the number of people using github (vast majority) and the number of people doing Ruby and RoR development on a day to day basis. It is always an exciting moment for me when I realize it is gaining in support because how much I love the language. In addition, everyone has been extremely helpful and friendly. We meet Tim Case the first day and he was more than willing to take us under his wing and show us around.

One thing that was both encouraging and discouraging is the number of women at the conference. There were women, thats the good news, the bad news is that I think from a ratio point of view the number of women at the conference is on par with what I have experienced at Ruby and RoR conferences in the US. That is to say its pretty small. Usually at conferences since there are so few women I can manage to talk to most of them and but here I have been some what intimidated by the language barrier. One other thing to point out is that there were no women speakers but hey that isn’t really that uncommon. I am hoping that when Obie does his talk and plugs DevChix for us that many of those women who were at the conference that I didn’t get to meet will come to the site and join.

Ladies Please Read
For those women who do happen to come to the site from Brazil and other countries. I would like to say that we have members world wide who can speak a number of different languages so please don’t let that discourage you from joining and participating. We would LOVE to have you all as part of the group. Also encourage other female developers you know.

If you are a women, a developer, interested in joining and/or contributing to DevChix, please contact Desi McAdam at info(-at-)devchix.com with your:

1. Name
2. Email
3. Do you know any one from DevChix?
4. A short 2 sentence bio describing your development background/experience (or what you hope to learn) and a link to your blog if you happen to have one.

Obrigado! :)

ˆ Back to top

Multiple object forms, delegation, and has_one…

June 3rd, 2008 by comment

I had an ah ha moment that maybe shouldn’t have been such an ah ha moment but it was so I figured I would share it. Yeah so I am sure most of us have had a situation where we needed to have multiple model forms. Most of the time now days I use attribute_fu to solve this issue but attribute_fu doesn’t work with has_one associations. Today I had a situation where I had two fields that were required for a has_one association object. Long story short it came to me that if we just used the delegate method provided by rails that we could essentially act like the attributes we were setting were on the parent model. This meant we only needed to create one form with multiple fields even though some of those fields were actually on a different model. I then remembered that back when I was working with the guys over at ThoughtWorks that we used a Ruby Extension called Forwardable to be able to delegate multiple attributes on one object.

So instead of this:

delegate :first_name, :to => :profile
delegate :last_name, :to => :profile
delegate :some_other_attribute, :to => :profile

side note: I’m not sure but I don’t believe delegate can take multiple attributes (I tried to look this up but for some reason couldn’t find the documentation for this method and didn’t have time to dig in the code)

You could do the following:

include the Ruby Extension Forwardable in the parent model class


include Forwardable

and then add this line:

def_delegators :profile, :first_name, :last_name, :some_other_attribute

So yeah that was my little ah ha moment. I am sure there are even better ways than this but this was better than what we were looking at doing to begin with.

ˆ Back to top

Rails Conf 2008

May 30th, 2008 by comment

Hello Ladies,
I am reporting from RailsConf 2008. The main focus of this post is logistics for the conference. I’ll be posting about the talks as soon as I get to attend one. I have been running around trying to take care of DevChix related stuff.

We were unable to get an official room for a BoF but I have decided we will just take over some area of the convention center. Lets meet outside Exhibit Hall E at 7:30 on Saturday night. We can discuss whatever we want to. We are also planning appetizers and cocktails after the BoF. Hashrocket Inc, the company I work for is sponsoring the evening. Thanks Hashrocket!

Please either come to the BoF for more information or find one of the ladies with a DevChix logo on their badges for more information. I will also have stickers to give out (until they run out).

We would love to meet ALL the women developers at the conference so please come out and get to know us.

Cheers
Desi

ˆ Back to top

Book Review, "Pro Active Record"

March 12th, 2008 by comment

Published by Apress
By Kevin Marshall, Chad Pytel, Jon Yurek
Book Info
Sample Chapter: Ch. 01 – Introducing Active Record
Table of Contents

Years ago when I was in PHP Land (now I travel quite a bit more! haha), I strugged for months with how to write a good ORM . It was tough, because I wanted to abstract the “boring logic” of retrieving records from a database without writing SQL but still remain flexible enough. I never really came up with a good model. I used the DAO from “extreme php” library which I think was a knock off from java. It was ok, but I still didn’t feel like I had “arrived”.

When I discovered Ruby on Rails, I found ActiveRecord. Ahh HA! Finally, this is what I was looking for. At first I thought it was part of Rails, but its not. Its a standalone library and you can use it with straight up ruby scripts.

I got a review copy of “Pro Active Record” some time ago and read it some when I got it, then some later, and now I am going to officially write up a review!

If you do anything with Active Record, get this book. The things that are briefly mentioned in most Rails books are described in detail in this book.

Chapter 1 – Introducing Active Record

Most of the time, the first chapters of a book are boring to me. I don’t need another “History of the Internet” or how “HTML was developed” … blah blah. But this one, the story is only 1 page. And it actually has some introductory scripts on using Active Record, so you can see right away how it works. It also explains the benefits of MVC and why ORMs are good. Some people still don’t get it!

Chapter 2 – Active Record and SQL

This chapter helps you translate the “sql in your head” to how to write it with Active Record. I’ve used Active Record so much that now I have forgotten most of my SQL, which is kind of embarrassing. :) I now find writing sql tedious and boring! I would have actually called this chapter “Demystifying Active Record” since it explains why all the dynamic finders work. You’ll also find transactions and locking explained here.

Chapter 3 – Setting up Your Database

Migrations! The Awesome Thing that can turn into a nightmare for large rails projects with multiple developers…. definitely have to decide on some best practices with your team on this one. The chapter has only one thing to say about this — assume any checked in migration has already been run by your team and the migration should not be edited and checked back in! You’ll have to make another migration file with your changes.

[tip]
Nola's Note: When you make a migration, test it both UP and DOWN!! Here's what I do --
write a migratiion
rake db:migrate (go up to the version with new code)
rake db:migrate VERSION=n-1, (go to version before the latest)
rake db:migrate (back to lastest)
rake db:migrate VERSION=0 (back to blank db)
rake db:migrate (back to latest)
[/tip]

Just to be sure its all good — even on a new database!

Chapter 4 – Core Features of Active Record

Now is the fun stuff – Callbacks. This is magic. This makes Active Record so flexible, and is one thing I could never figure out how to do with my PHP ORMs. I use call backs to set defaults for fields. If its just a straight default, then I set it in the database but if I need to make a decision, (if this field then this field..) then I can use it in a callback.

Associations – at first this is very confusing! I don’t know how many times I got “has_many” and “belongs_to” mixed around in the beginning.

Validations – Awesome. I had to do some ruby code without a database and I really really really missed the validations. It took me like 5x longer than it should! Understanding all of these validation methods will make your life so much more enjoyable. I really really hate doing boring, repetitive stuff…it seems so wasteful to me.

Chapter 5 – Bonus Features

Everybody likes a bonus and this isn’t even the last chapter of the book.

Java people will like the Active Record Observers — seems a little AOP to me (aspect orienteted programming) and something I probably have neglected to use to their fullest extent.

Acting up — Learn how to “save time” with the “acts_as” magic: List, Tree, Nested Sets. If your data needs these structures, you got it made. I can imaging how much longer it would take to write this stuff in perl or php.

Composed of – I haven’t used this, but this looks like a good way to make sensible objects out of database tables. There is quite a bit of explanation and examples of this, it will come in handy.

There are a few other in depth explanations of things, such as method_missing which is how alot of the magic happens. Rock on.

Chapter 6 – Active Record Testing and Debugging

Ahh yes, Testing. My favorite subject. My friends who know how much I love testing say I am sick. I must have an inner need to PROVE I am right or something, haha.

The chapter goes into depth about using test_unit with Active Record, sadly no RSpec. But, it does go into all the error messages that Active Record throws so you can write good try/catch blocks and make very exact error messages (probably best logged for the admin rather then displayed to the user!)

Chapter 7 – Working with Legacy Schema

Here’s how you work with that old database that just won’t die… or that management won’t let you totally redo. Active Record follows some of the principles of Rails “convention over configuration” … relying on table and column naming conventions to figure out how to build your object….but still giving you a way out if you want your tables singular and your primary id field called “myawesomeid” instead of “id”

I’ve used some of these things on an older database and it was possible! Not too bad if thats what you have to work with.

[soapbox]
Some people find this annoying "oh gosh! my library can't make decisions for me! OMG! That sucks" .. to that I say, "Umm ok. But if you follow these conventions then I can come into your project and know exactly what is going on" ... like with web standards, we all harp on how IE and FF do things differently, yet people want to bellyache about Active Record preferring to have plural names and id field called "id". Right.

Follow the dang convention and find something worth complaining about to complain about. :)
[/soapbox]


Chapter 8 – Active Record and The Real World

This chapter goes into depth about the library and encourages you to go read the Active Record code. Always a good idea to know what it is you are using :) I’ve actually learned ruby better by reading source code. The chapter walks you through basic structure of the files. Very cool.

[soapbox]
I used to work at a place that didn't like any "outside code" because they were afraid "OMG ... it will send our passwords to Russia!" ... ok, well I am not an idiot. I read over any code that I use that I didn't write. I look at the tests to see if I am using it right. I even RUN the tests so I can be sure its working as advertised.
[/soapbox]

Alternatives to Active Record – with EXAMPLES! If something about Active Record doesn’t set too well with you, take a look at the alternatives. Sometimes I look at the alternatives and decide that the first wasn’t so bad after all. You’ll find examples of DBI, Og, ActiveRelation.

Finally a section on Q and A finishes up this book. The Appendix has a complete reference of ActiveRecord methods to make this book a well rounded reference, tips, documentation and very handy to have at your desk!

ˆ Back to top

cheap research papers