<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>e168f08 - Latest Comments in Protected: Assignment 2B: Optional ActiveRecord practice</title><link>http://e168f08.disqus.com/</link><description></description><atom:link href="https://e168f08.disqus.com/protected_assignment_2b_optional_activerecord_practice/latest.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Tue, 28 Oct 2008 10:08:29 -0000</lastBuildDate><item><title>Re: Protected: Assignment 2B: Optional ActiveRecord practice</title><link>http://e168f08.plugh.org/assignments/assignment-2b-optional-activerecord-practice/#comment-3341750</link><description>&lt;p&gt;ok... got it now...  adding the t.references to the migration made it work...&lt;/p&gt;&lt;p&gt;I just needed to create the table as normal, using the migration and then add in t.references.  That automatically generated the reference between the tables.  And when I call find on the table linked to the history table, I can access data in the history table through the reference which is returned.&lt;/p&gt;&lt;p&gt;Like pretty much everything in life, it's easy once you know how to do it.&lt;/p&gt;&lt;p&gt;Mike&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">philadelphia</dc:creator><pubDate>Tue, 28 Oct 2008 10:08:29 -0000</pubDate></item><item><title>Re: Protected: Assignment 2B: Optional ActiveRecord practice</title><link>http://e168f08.plugh.org/assignments/assignment-2b-optional-activerecord-practice/#comment-3335959</link><description>&lt;p&gt;Thanks...  I like the poof. Magic part.  Will check it out in the AM.&lt;/p&gt;&lt;p&gt;Take care,&lt;br&gt;Mike&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">philadelphia</dc:creator><pubDate>Mon, 27 Oct 2008 22:31:59 -0000</pubDate></item><item><title>Re: Protected: Assignment 2B: Optional ActiveRecord practice</title><link>http://e168f08.plugh.org/assignments/assignment-2b-optional-activerecord-practice/#comment-3335858</link><description>&lt;p&gt;-- Create foreign keys in the migration step.&lt;br&gt;-- Create associations (i.e., declare methods that the Ruby code will use to follow the keys) in the Models.&lt;/p&gt;&lt;p&gt;Again, take a look at migrations1. One thing you will see there is that in a migration, you can use a pseudo-data-type called "references" which will create the properly named key for you. It's confusing because you use the model name. In your case, you would put in your migration for card_histories:&lt;/p&gt;&lt;p&gt;t.references :history&lt;/p&gt;&lt;p&gt;poof. Magic. This is just a synonym for: t.integer :history_id&lt;/p&gt;&lt;p&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jgn</dc:creator><pubDate>Mon, 27 Oct 2008 22:25:26 -0000</pubDate></item><item><title>Re: Protected: Assignment 2B: Optional ActiveRecord practice</title><link>http://e168f08.plugh.org/assignments/assignment-2b-optional-activerecord-practice/#comment-3335784</link><description>&lt;p&gt;I'll grab the latest AWDR tomorrow morning...&lt;/p&gt;&lt;p&gt;My "other" table is called CardHistory (card_histories in sql land).  It has a a "belongs_to :history" declared within it.&lt;/p&gt;&lt;p&gt;Within History, I had declared: "has_many :card_histories".&lt;/p&gt;&lt;p&gt;I had hoped the two statements would create the necessary FKs.  I see that they do not.  Am I supposed to create them in the migration step?  i.e. within the 1_create_histories.rb? (I did not think so based upon the docs).&lt;/p&gt;&lt;p&gt;Mike&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">philadelphia</dc:creator><pubDate>Mon, 27 Oct 2008 22:20:34 -0000</pubDate></item><item><title>Re: Protected: Assignment 2B: Optional ActiveRecord practice</title><link>http://e168f08.plugh.org/assignments/assignment-2b-optional-activerecord-practice/#comment-3335679</link><description>&lt;p&gt;Mike,&lt;/p&gt;&lt;p&gt;The "id" column on histories is that table's PRIMARY KEY. If, for instance, you created a table cards which belonged to a history, then cards would have a foreign key called history_id. For each row in cards, Each value in cards.history_id would be a value from the id column of histories. In other words, each row in cards "refers" to a row in histories.&lt;/p&gt;&lt;p&gt;If you have the newest PDF for AWDR, take a look at the top of p. 339. For both line_items and orders, the primary key is called "id." Since a row in line_items "belongs to" an order, line_items gets the foreign key with the name "order_id."&lt;/p&gt;&lt;p&gt;What is your "other" table? Does a History "have many" of that other table, or does it "belong to" that other table? That will help you see how the migration should be set up.&lt;/p&gt;&lt;p&gt;John&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jgn</dc:creator><pubDate>Mon, 27 Oct 2008 22:09:51 -0000</pubDate></item><item><title>Re: Protected: Assignment 2B: Optional ActiveRecord practice</title><link>http://e168f08.plugh.org/assignments/assignment-2b-optional-activerecord-practice/#comment-3335592</link><description>&lt;p&gt;I was shocked as well... I thought that the convention used in the migration would have created a history_id key, for example.  Sadly, this was not the case.  Instead, I wound up with a plain old id column.  That was what caused me about 4 hours of confusion...    How can we get the migration to work as expected?&lt;/p&gt;&lt;p&gt;Here is my migration to create the histories table:&lt;/p&gt;&lt;p&gt;class CreateHistories &amp;lt; ActiveRecord::Migration&lt;/p&gt;&lt;p&gt;  def self.up&lt;br&gt;    create_table :histories, :force =&amp;gt; true do |t|&lt;br&gt;      t.string :card_sequence&lt;br&gt;      t.integer :strength&lt;br&gt;    end&lt;br&gt;  end&lt;/p&gt;&lt;p&gt;  def self.down&lt;br&gt;    drop_table :histories&lt;br&gt;  end&lt;/p&gt;&lt;p&gt;end&lt;/p&gt;&lt;p&gt;Why would it not create a history_id column, and instead create a generic "id" col?&lt;/p&gt;&lt;p&gt;Mike&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">philadelphia</dc:creator><pubDate>Mon, 27 Oct 2008 22:00:15 -0000</pubDate></item><item><title>Re: Protected: Assignment 2B: Optional ActiveRecord practice</title><link>http://e168f08.plugh.org/assignments/assignment-2b-optional-activerecord-practice/#comment-3335508</link><description>&lt;p&gt;One thing I will be talking about Wednesday night is the need to always follow Rails conventions for foreign key column names. If you look at the migrations1 project (from the downloads page), look at User and Stock -- notice that I didn't have to specify any :foreign_key&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jgn</dc:creator><pubDate>Mon, 27 Oct 2008 21:54:22 -0000</pubDate></item><item><title>Re: Protected: Assignment 2B: Optional ActiveRecord practice</title><link>http://e168f08.plugh.org/assignments/assignment-2b-optional-activerecord-practice/#comment-3335414</link><description>&lt;p&gt;Well, I have some tips.&lt;/p&gt;&lt;p&gt;One is that you want to write a list of sentences that describe the relationships between the models. E.g., you want to write sentences like:&lt;/p&gt;&lt;p&gt;A Hand has many Cards.&lt;br&gt;A Card belongs to a Hand.&lt;/p&gt;&lt;p&gt;You should also try and make some statements about uniqueness. These statements about uniqueness will frequent reveal other things you need to model. For example:&lt;/p&gt;&lt;p&gt;For all Hands, each Card must be unique.&lt;/p&gt;&lt;p&gt;This is a very tricky sentence. The reason is that we rarely think of cards needing to be unique across HANDS; rather, we think of uniqueness in terms of a Deck. This starts to push you to modeling:&lt;/p&gt;&lt;p&gt;A Card belongs to a Deck.&lt;br&gt;A Card also belongs to a Hand.&lt;br&gt;Each card is unique in the Deck.&lt;/p&gt;&lt;p&gt;Finally, you should think about whether an entity CAN belong to another entity -- but maybe it doesn't have to. E.g.,&lt;/p&gt;&lt;p&gt;A Card MUST belong to a Deck.&lt;br&gt;A Card MAY belong to a Hand.&lt;br&gt;Each card is unique in the Deck.&lt;/p&gt;&lt;p&gt;Etc.&lt;/p&gt;&lt;p&gt;All of these things will help you clarify what you're doing.&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jgn</dc:creator><pubDate>Mon, 27 Oct 2008 21:48:23 -0000</pubDate></item><item><title>Re: Protected: Assignment 2B: Optional ActiveRecord practice</title><link>http://e168f08.plugh.org/assignments/assignment-2b-optional-activerecord-practice/#comment-3335396</link><description>&lt;p&gt;OK!  Now I have it a bit better figured out!&lt;/p&gt;&lt;p&gt;Gotta love Google :-)  &lt;a href="http://www.nabble.com/has_many-and-belongs_to-in-rails-2.0.2-(child.Parent)-is-not-working-td15637100.html" rel="nofollow noopener" target="_blank" title="http://www.nabble.com/has_many-and-belongs_to-in-rails-2.0.2-(child.Parent)-is-not-working-td15637100.html"&gt;http://www.nabble.com/has_m...&lt;/a&gt;&lt;/p&gt;&lt;p&gt;The above link points out my issue.  I confirmed that the DB has "ID" as the key names.  So, when using the belongs_to/has_many, I needed to specify that "id" is the foreign key.  Once I did that using the following syntax, "belongs_to :history, :foreign_key =&amp;gt; :id", it works just fine.&lt;/p&gt;&lt;p&gt;I am now able to get at the data in the associated table by calling a find in a table with a FK/PK relationship.  So, I can call &amp;lt;new table=""&amp;gt;.find(1) and get at the contents of the table &amp;lt;new table=""&amp;gt; links to.&lt;/p&gt;&lt;p&gt;OK... enough for tonight.  WIl complete tomorrow.&lt;/p&gt;&lt;p&gt;Take care,&lt;br&gt;Mike&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">philadelphia</dc:creator><pubDate>Mon, 27 Oct 2008 21:47:20 -0000</pubDate></item><item><title>Re: Protected: Assignment 2B: Optional ActiveRecord practice</title><link>http://e168f08.plugh.org/assignments/assignment-2b-optional-activerecord-practice/#comment-3334781</link><description>&lt;p&gt;I don't have it fully functioning.  I'm trying to create a new table which will contain all of the cards used.  Then, the plan is to be able to create a relationship between the cards used and the hands formulated from them.  So, for example, you should be able to see the hands in which the 3 of Clubs was a member.    The tables are tied together using a PK-FK relationship which maps to a belongs_to/has_many relationship in Ruby.&lt;/p&gt;&lt;p&gt;The thing is that I'm still having a bit of an issue getting it to work quite right...  I'm trying to use the "line_items/product" example in the rails book.  In that example, there is a third table which maps the keys from the product and orders tables to the line_items table.  There, they use the find method against the line_items table to return a reference to a line_items object.  And this object, in turn, has a reference to the products (and orders) table.  This is used to get access to column information in the products table.&lt;/p&gt;&lt;p&gt;In using mine, I'm not trying to use the third table.  Instead, I'm using the belongs_to in the model for the new table I created to contain  the cards, and I'm using has_many in the model I'm using for the history.  Each pointing to each other's auto generated id....  BUT it's currently returning nil from my query on the new cards table.  I had hoped it would return a reference which I could use to get at the history table and its member columns.  So, I guess I'm a bit stuck right now... Still scratching my head a bit.&lt;/p&gt;&lt;p&gt;Mike&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">philadelphia</dc:creator><pubDate>Mon, 27 Oct 2008 21:03:23 -0000</pubDate></item><item><title>Re: Protected: Assignment 2B: Optional ActiveRecord practice</title><link>http://e168f08.plugh.org/assignments/assignment-2b-optional-activerecord-practice/#comment-3334562</link><description>&lt;p&gt;Mike,&lt;/p&gt;&lt;p&gt;Great.&lt;/p&gt;&lt;p&gt;Could you explain at a high level what your extra tables are doing? I think other students would be very interested. You don't have to get into implementation details: Just what you're "modeling" with the tables.&lt;/p&gt;&lt;p&gt;John&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jgn</dc:creator><pubDate>Mon, 27 Oct 2008 20:47:54 -0000</pubDate></item><item><title>Re: Protected: Assignment 2B: Optional ActiveRecord practice</title><link>http://e168f08.plugh.org/assignments/assignment-2b-optional-activerecord-practice/#comment-3334261</link><description>&lt;p&gt;Never mind... brain freeze... Should have been looking at the column name in the resulting row.... Dumb mistake.  All working now.&lt;/p&gt;&lt;p&gt;Mike&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">philadelphia</dc:creator><pubDate>Mon, 27 Oct 2008 20:24:07 -0000</pubDate></item><item><title>Re: Protected: Assignment 2B: Optional ActiveRecord practice</title><link>http://e168f08.plugh.org/assignments/assignment-2b-optional-activerecord-practice/#comment-3334159</link><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;I'm trying to implement the "Second Job" on Assignment 2b.  I've created a new migration (creating a table) and a helper associated with the new table.  In the History helper, I've added a has_many pointing to the new table, and in the new helper, I've added a belongs_to pointing to the histories table.&lt;/p&gt;&lt;p&gt;What I want to do is use the find(some id #) to look for a specific id and then return the corresponding record from the histories table.&lt;/p&gt;&lt;p&gt;I've read through the docs, and I thought I could call &amp;lt;new&amp;gt;.find(1).history.strength_human_readable, where the result of the find would return an object with a reference to the history table, which I could then use to call the strength_human_readable method.  No joy here.  I _can_ call the find method on the histories and the &amp;lt;new&amp;gt; independently, but I can't seem to get to the PK table... Do I need to use :through???&lt;/p&gt;&lt;p&gt;Any suggestions are appreciated.&lt;/p&gt;&lt;p&gt;Mike&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">philadelphia</dc:creator><pubDate>Mon, 27 Oct 2008 20:16:24 -0000</pubDate></item><item><title>Re: Protected: Assignment 2B: Optional ActiveRecord practice</title><link>http://e168f08.plugh.org/assignments/assignment-2b-optional-activerecord-practice/#comment-3309549</link><description>&lt;p&gt;OK... got it.&lt;/p&gt;&lt;p&gt;Thanks,&lt;br&gt;Mike&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">philadelphia</dc:creator><pubDate>Sun, 26 Oct 2008 09:12:11 -0000</pubDate></item><item><title>Re: Protected: Assignment 2B: Optional ActiveRecord practice</title><link>http://e168f08.plugh.org/assignments/assignment-2b-optional-activerecord-practice/#comment-3304885</link><description>&lt;p&gt;Leveraging #abbrev is a good way to do it.&lt;/p&gt;&lt;p&gt;I don't think you should twitch too much when a constant is defined -- 'cos the refactoring to create objects based on such constants is probably going to be pretty easy. The twitching should occur when you see "5" used in a computation.&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jgn</dc:creator><pubDate>Sat, 25 Oct 2008 21:17:16 -0000</pubDate></item><item><title>Re: Protected: Assignment 2B: Optional ActiveRecord practice</title><link>http://e168f08.plugh.org/assignments/assignment-2b-optional-activerecord-practice/#comment-3304790</link><description>&lt;p&gt;That's what I had done, before posting, and subsequently I did it in two other ways:&lt;/p&gt;&lt;p&gt;First, I modified my &amp;lt;=&amp;gt; operator to provide a total ordering, but ordering by card_number just feels wrong, for any card game, so I made my Card#&amp;lt;=&amp;gt; return (card_number &amp;lt;=&amp;gt; card_number) only if the ranks were equal.&lt;/p&gt;&lt;p&gt;Second approach was for Hand#ordered_cards to pass a block to sort, imposing its own ordering on the cards.&lt;/p&gt;&lt;p&gt;My third approach is the one I like the best, which doesn't rely on the existence of Card#&amp;lt;=&amp;gt; at all, which was to map each card to its abbrev before sorting the array:  the body of Hand#ordered_cards is then&lt;/p&gt;&lt;p&gt;    &lt;a href="http://Array.new" rel="nofollow noopener" target="_blank" title="Array.new"&gt;Array.new&lt;/a&gt;(CARDS_PER_HAND) {|i| self[i].abbrev}.sort.join('')&lt;/p&gt;&lt;p&gt;(where CARDS_PER_HAND was already defined as 5 in constants.rb, because I get severe twitches when I see raw numerical constants anywhere in any code).&lt;/p&gt;&lt;p&gt;Modifying your version of ordered_cards, this would be&lt;/p&gt;&lt;p&gt;def ordered_cards  &lt;br&gt;  cards = &lt;a href="http://Array.new" rel="nofollow noopener" target="_blank" title="Array.new"&gt;Array.new&lt;/a&gt;  &lt;br&gt;  (0..4).each { |i| cards[i] = self[i].abbrev }&lt;br&gt;end&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Morris</dc:creator><pubDate>Sat, 25 Oct 2008 21:06:27 -0000</pubDate></item><item><title>Re: Protected: Assignment 2B: Optional ActiveRecord practice</title><link>http://e168f08.plugh.org/assignments/assignment-2b-optional-activerecord-practice/#comment-3304707</link><description>&lt;p&gt;Oh, good question.&lt;/p&gt;&lt;p&gt;Think broadly. For example, at present the idea of a dealt hand is represented by a String. But arguably you could represent each *dealt* card in a separate table ("dealt_cards") with foreign keys to a row in a "cards" table and then to a specific Hand into which it was dealt.&lt;/p&gt;&lt;p&gt;In the model I proposed for 2B to get you started, there is only the fact of the hand having had its strength computed before (or not). But there are good arguments for representing quite a lot more of what is happening.&lt;/p&gt;&lt;p&gt;If you had a table called dealt_cards or some such, you could then run queries over that table to determine which cards have historically generated the strongest hands and so forth.&lt;/p&gt;&lt;p&gt;-----&lt;/p&gt;&lt;p&gt;Another way to look at this is as follows:&lt;/p&gt;&lt;p&gt;Most times when you save data, you are leaving things out (you are choosing to save certain aspects of the state of your app instead of others). So think about the strength computation in its context -- what data isn't getting saved? How could you save it? Does it have any value? Etc.&lt;/p&gt;&lt;p&gt;That question #7 is really a challenge to you to take a fresh look at the assignment and think about what else might be persisted.&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jgn</dc:creator><pubDate>Sat, 25 Oct 2008 20:52:51 -0000</pubDate></item><item><title>Re: Protected: Assignment 2B: Optional ActiveRecord practice</title><link>http://e168f08.plugh.org/assignments/assignment-2b-optional-activerecord-practice/#comment-3304543</link><description>&lt;p&gt;Yup... I got all that.  I had already done the exercise, and it works fine...  I was referring to the second part of the assignment, captured below.&lt;/p&gt;&lt;p&gt;"7. Second job: Review the associations section of AWDR. If you could introduce one or two more models, what would they be? And how would they be associated with the History model?"&lt;/p&gt;&lt;p&gt;I just do not know what you had in mind here.&lt;/p&gt;&lt;p&gt;Mike&lt;/p&gt;&lt;p&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">philadelphia</dc:creator><pubDate>Sat, 25 Oct 2008 20:30:57 -0000</pubDate></item><item><title>Re: Protected: Assignment 2B: Optional ActiveRecord practice</title><link>http://e168f08.plugh.org/assignments/assignment-2b-optional-activerecord-practice/#comment-3304459</link><description>&lt;p&gt;Some students have reported that their solutions to assignment 2 take many seconds to pass the tests -- it it may in fact be more relevant in the real world than it appears at first blush.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jgn</dc:creator><pubDate>Sat, 25 Oct 2008 20:19:15 -0000</pubDate></item><item><title>Re: Protected: Assignment 2B: Optional ActiveRecord practice</title><link>http://e168f08.plugh.org/assignments/assignment-2b-optional-activerecord-practice/#comment-3304453</link><description>&lt;p&gt;Mike,&lt;/p&gt;&lt;p&gt;It is not uncommon that instead of computing the result of a method, you look up a pre-computed value somewhere. This is called "memoization" or "caching."&lt;/p&gt;&lt;p&gt;In this exercise, you check the incoming hand that is being evaluated for strength. If the strength for the hand has already been computed and is found in a database table, you return that pre-computed value. If the incoming hand isn't found in the database, then you compute the strength (as you already already doing), and store the result in the database (so that the next time you can use the database value rather than compute it).&lt;/p&gt;&lt;p&gt;That's it. Nothing more, nothing less.&lt;/p&gt;&lt;p&gt;The upshot for you is:&lt;/p&gt;&lt;p&gt;(1) You get experience with ActiveRecord;&lt;br&gt;(2) You get some experience with ActiveRecord outside of Rails (believe me, this is important),&lt;br&gt;(3) You get to do so with a problem domain you already understand;&lt;br&gt;(4) You exercise a technique that you will almost surely need to implement at some point;&lt;/p&gt;&lt;p&gt;OK?&lt;/p&gt;&lt;p&gt;John&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jgn</dc:creator><pubDate>Sat, 25 Oct 2008 20:18:34 -0000</pubDate></item><item><title>Re: Protected: Assignment 2B: Optional ActiveRecord practice</title><link>http://e168f08.plugh.org/assignments/assignment-2b-optional-activerecord-practice/#comment-3304393</link><description>&lt;p&gt;The assumption (probably not valid in this case) is that figuring out the strength of a hand is computation-intensive, and that it would be efficient to cache the result of that computation, once you've figured out the strength once, and then more efficient to look it up in the database than to re-compute it.  Try to imagine hand-strength computation as some computation that takes a lot of compute time.&lt;/p&gt;&lt;p&gt;The functionality we're implementing here is storing hand strengths in a database for lookup.  It's not really a good real-world example, just an exercise in Creating and Reading database rows using ActiveRecord.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Morris</dc:creator><pubDate>Sat, 25 Oct 2008 20:09:52 -0000</pubDate></item><item><title>Re: Protected: Assignment 2B: Optional ActiveRecord practice</title><link>http://e168f08.plugh.org/assignments/assignment-2b-optional-activerecord-practice/#comment-3304344</link><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;I'm confused on 2B part 2...  I've read AWDR; the class notes; and the rails guide online.  I understand pretty well what the models do and how they are used.  But I'm not sure what functionality you are interested in implementing...&lt;/p&gt;&lt;p&gt;Mike&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">philadelphia</dc:creator><pubDate>Sat, 25 Oct 2008 20:02:35 -0000</pubDate></item><item><title>Re: Protected: Assignment 2B: Optional ActiveRecord practice</title><link>http://e168f08.plugh.org/assignments/assignment-2b-optional-activerecord-practice/#comment-3301296</link><description>&lt;p&gt;Maureen: Assignment 2B is entirely optional. There is no due date, and we won't be grading it.&lt;/p&gt;&lt;p&gt;Having said that, the time to do it is RIGHT NOW, because it works quite well with the lecture I just gave.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jgn</dc:creator><pubDate>Sat, 25 Oct 2008 17:09:06 -0000</pubDate></item><item><title>Re: Protected: Assignment 2B: Optional ActiveRecord practice</title><link>http://e168f08.plugh.org/assignments/assignment-2b-optional-activerecord-practice/#comment-3300800</link><description>&lt;p&gt;When  is this one due?  I've been looking for the date for awhile :)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">MaureenB</dc:creator><pubDate>Sat, 25 Oct 2008 16:08:25 -0000</pubDate></item><item><title>Re: Protected: Assignment 2B: Optional ActiveRecord practice</title><link>http://e168f08.plugh.org/assignments/assignment-2b-optional-activerecord-practice/#comment-3297017</link><description>&lt;p&gt;Good point.&lt;/p&gt;&lt;p&gt;I think in the typical case most students would have implement Card#&amp;lt;=&amp;gt; by immediately delegating to Fixnum#&amp;lt;=&amp;gt; to whatever internally was providing card_number back. You are right that I underspecified it, and under-tested it -- I didn't anticipate that someone would implement Card#&amp;lt;=&amp;gt; as though it can only be used for Poker.&lt;/p&gt;&lt;p&gt;For 2B: In your case, adapt the code so that the sort comes out so that ordered_cards is reproducible.&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jgn</dc:creator><pubDate>Sat, 25 Oct 2008 07:58:01 -0000</pubDate></item></channel></rss>