<?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 3</title><link>http://e168f08.disqus.com/</link><description></description><atom:link href="https://e168f08.disqus.com/protected_assignment_3/latest.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Tue, 11 Nov 2008 00:38:59 -0000</lastBuildDate><item><title>Re: Protected: Assignment 3</title><link>http://e168f08.plugh.org/assignment-3/#comment-3675014</link><description>&lt;p&gt;Can we have the rest of the assignment?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ana</dc:creator><pubDate>Tue, 11 Nov 2008 00:38:59 -0000</pubDate></item><item><title>Re: Protected: Assignment 3</title><link>http://e168f08.plugh.org/assignment-3/#comment-3673925</link><description>&lt;p&gt;Nice. This one was tricky. Had to root around in the book for a while!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">rajatbaner</dc:creator><pubDate>Mon, 10 Nov 2008 23:36:52 -0000</pubDate></item><item><title>Re: Protected: Assignment 3</title><link>http://e168f08.plugh.org/assignment-3/#comment-3604929</link><description>&lt;p&gt;Possibly - let me get back to this topic in a bit.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jgn</dc:creator><pubDate>Fri, 07 Nov 2008 18:00:24 -0000</pubDate></item><item><title>Re: Protected: Assignment 3</title><link>http://e168f08.plugh.org/assignment-3/#comment-3604368</link><description>&lt;p&gt;Might it be possible to get MilestoneII? It would be nice to get the jump on it while I have some extra cycles.&lt;br&gt;Thanks&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">vaughanatworld</dc:creator><pubDate>Fri, 07 Nov 2008 17:33:09 -0000</pubDate></item><item><title>Re: Protected: Assignment 3</title><link>http://e168f08.plugh.org/assignment-3/#comment-3572152</link><description>&lt;p&gt;I used OmniGraffle for the Mac. (Actually OmniGraffle Pro.)&lt;/p&gt;&lt;p&gt;The diagram for the "Child-Care Coop" over here -- &lt;a href="http://e168f07.7fff.com/assignments/assignments-4-5-and-6-overview/" rel="nofollow noopener" target="_blank" title="http://e168f07.7fff.com/assignments/assignments-4-5-and-6-overview/"&gt;http://e168f07.7fff.com/ass...&lt;/a&gt; -- was done with Microsoft Visio.&lt;/p&gt;&lt;p&gt;OmniGraffle is marginal for database diagrams. To do the Graffle diagram I had to download a user-contributed stencil -- &lt;a href="http://graffletopia.com/stencils/318" rel="nofollow noopener" target="_blank" title="http://graffletopia.com/stencils/318"&gt;http://graffletopia.com/ste...&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I haved a lot of these tools, and I guess looking at all of the different aspects -- use of use, appearance of the final document, etc. -- I'd have to say that Visio is the best. Also, for some databases, Visio can "reverse-engineer" a database: You connect to the database with ODBC, and Visio will suck all of the metadata out. It doesn't always work, though.&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jgn</dc:creator><pubDate>Thu, 06 Nov 2008 12:51:31 -0000</pubDate></item><item><title>Re: Protected: Assignment 3</title><link>http://e168f08.plugh.org/assignment-3/#comment-3571278</link><description>&lt;p&gt;What software did you use to create the database schema image?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">douglashall</dc:creator><pubDate>Thu, 06 Nov 2008 11:57:13 -0000</pubDate></item><item><title>Re: Protected: Assignment 3</title><link>http://e168f08.plugh.org/assignment-3/#comment-3564015</link><description>&lt;p&gt;When you write this: "It seems that the count needing to be returned by the "observations" method (in the User class) has to join first to the "observation_set" table and then to the "observation" table. I am not sure how to do that in a method...."&lt;/p&gt;&lt;p&gt;Notice that in the instructions I write: "Note: Association #9 is only on User, and goes to Observation."&lt;/p&gt;&lt;p&gt;Hint, hint: A user has many observations . . . through . . . something. You figure out the rest.&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>Wed, 05 Nov 2008 22:44:13 -0000</pubDate></item><item><title>Re: Protected: Assignment 3</title><link>http://e168f08.plugh.org/assignment-3/#comment-3563996</link><description>&lt;p&gt;Thanks -- fixed those up w/ a message at the top of the assignment.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jgn</dc:creator><pubDate>Wed, 05 Nov 2008 22:42:12 -0000</pubDate></item><item><title>Re: Protected: Assignment 3</title><link>http://e168f08.plugh.org/assignment-3/#comment-3563989</link><description>&lt;p&gt;Congrats!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jgn</dc:creator><pubDate>Wed, 05 Nov 2008 22:41:31 -0000</pubDate></item><item><title>Re: Protected: Assignment 3</title><link>http://e168f08.plugh.org/assignment-3/#comment-3562545</link><description>&lt;p&gt;simple error on the UnitTest... had set the scope within unit to the wrong field... all passing in &amp;lt;rake unit="" test=""&amp;gt; now.  (woohoo :-))&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>Wed, 05 Nov 2008 20:33:15 -0000</pubDate></item><item><title>Re: Protected: Assignment 3</title><link>http://e168f08.plugh.org/assignment-3/#comment-3561748</link><description>&lt;p&gt;OK... got past the issue.  I was trying to create a relationship from observation_set to observations, through units...  I thought we need to do this based upon (mis) reading the diagram...  Guess I should keep it right side up :-)&lt;/p&gt;&lt;p&gt;When I removed this association, I am reduced to a single error... having to do with UnitTest.  Debugging this now.&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>Wed, 05 Nov 2008 19:32:40 -0000</pubDate></item><item><title>Re: Protected: Assignment 3</title><link>http://e168f08.plugh.org/assignment-3/#comment-3561386</link><description>&lt;p&gt;Yup.. I had seen the note....  Maybe we're working off different book versions and page 340 is not the same in my book.  I had looked it up, but did not see the relevance 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>Wed, 05 Nov 2008 19:06:39 -0000</pubDate></item><item><title>Re: Protected: Assignment 3</title><link>http://e168f08.plugh.org/assignment-3/#comment-3561063</link><description>&lt;p&gt;Thanks -- I left out that crucial line: run the migrations! Will fix. *DO* put &lt;a href="http://Demo.run" rel="nofollow noopener" target="_blank" title="Demo.run"&gt;Demo.run&lt;/a&gt; inside of quotation marks. You want to be able to put spaces into that param, so get in the habit of quoting what is being passed to script/runner&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jgn</dc:creator><pubDate>Wed, 05 Nov 2008 18:38:12 -0000</pubDate></item><item><title>Re: Protected: Assignment 3</title><link>http://e168f08.plugh.org/assignment-3/#comment-3561021</link><description>&lt;p&gt;Mike,&lt;/p&gt;&lt;p&gt;Did you see this note at the end of the assignment description: "Note: One of the tricker associations is ObservationSet.preferred_unit - take a look at p. 340 in AWDR."&lt;/p&gt;&lt;p&gt;That is the only thing in ObservationSet that is not vanilla. Basically, you want the ASSOCIATION to be preferred_unit while leveraging the underlying foreign key unit_id&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jgn</dc:creator><pubDate>Wed, 05 Nov 2008 18:35:34 -0000</pubDate></item><item><title>Re: Protected: Assignment 3</title><link>http://e168f08.plugh.org/assignment-3/#comment-3560421</link><description>&lt;p&gt;Anita, everyone: That is just a flat-out error on my part. notes should be of type text, and amount should have precision 8 and scale 2. See the note at the very top.&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jgn</dc:creator><pubDate>Wed, 05 Nov 2008 17:55:32 -0000</pubDate></item><item><title>Re: Protected: Assignment 3</title><link>http://e168f08.plugh.org/assignment-3/#comment-3559363</link><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;I'm pretty stuck on a couple of errors surrounding observation_sets...  Does the solution involve the use of ":source"?&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>Wed, 05 Nov 2008 16:46:52 -0000</pubDate></item><item><title>Re: Protected: Assignment 3</title><link>http://e168f08.plugh.org/assignment-3/#comment-3558915</link><description>&lt;p&gt;I found the problem, after trying all your suggestions. I had the test for format and uniqueness inside of the "name" method. Once I took them out, then those two "User" table failures were cured.&lt;/p&gt;&lt;p&gt;Now I am onto that last remaining error:&lt;/p&gt;&lt;p&gt;test_2000_assoc_9(UserTest):&lt;br&gt;NoMethodError: undefined method `Observation' for #&amp;lt;class:0x2b558a4&amp;gt;&lt;br&gt;    c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/base.rb:1672:in `method_missing'&lt;br&gt;    C:/ruby/assignment03/app/models/user.rb:17:in `observations'&lt;br&gt;    ./test/unit/user_test.rb:32:in `test_2000_assoc_9'&lt;br&gt;    c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/testing/setup_and_teardown.rb:33:in `__send__'&lt;br&gt;    c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/testing/setup_and_teardown.rb:33:in `run'&lt;/p&gt;&lt;p&gt;It seems that the count needing to be returned by the "observations" method (in the User class) has to join first to the "observation_set" table and then to the "observation" table. I am not sure how to do that in a method....&lt;/p&gt;&lt;p&gt;I also would like your assistance in getting the "CheckLogin.tryit" script that you suggest working. That sounds like a valuable tool. My implementation appears to run, but it returns nothing.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">swithin</dc:creator><pubDate>Wed, 05 Nov 2008 16:23:54 -0000</pubDate></item><item><title>Re: Protected: Assignment 3</title><link>http://e168f08.plugh.org/assignment-3/#comment-3558882</link><description>&lt;p&gt;I ran into similar issues with the schema, with slightly different error messages (different versions of sqlite?  Windows vs. Mac?).&lt;br&gt;The resolutions are:&lt;br&gt;   The schema in the jpg says that notes should be of type :string, but schema_comparison.rb is looking for type :text&lt;br&gt;   Although not specified in the schema diagram, the comparison test expects the amount to have a precision of 8 and a scale of 2.&lt;/p&gt;&lt;p&gt;After changing t.string to t.text for :notes, and adding :precision and :scale options for amount, schema_comparison.rb stops complaining&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Morris</dc:creator><pubDate>Wed, 05 Nov 2008 16:22:28 -0000</pubDate></item><item><title>Re: Protected: Assignment 3</title><link>http://e168f08.plugh.org/assignment-3/#comment-3558772</link><description>&lt;p&gt;With all of the tests passing (schema comparison and rake test:units), I tried running the demo program, following the instructions as given:&lt;br&gt;I copied the data migrations into my db/migrate directory (directly, not in a sub-directory), and then tried running&lt;/p&gt;&lt;p&gt;script\runner "&lt;a href="http://Demo.run" rel="nofollow noopener" target="_blank" title="Demo.run"&gt;Demo.run&lt;/a&gt;"&lt;/p&gt;&lt;p&gt;converting the / to a \ because I'm on Windows.  This didn't work, because DOS isn't hip to Unix-style "#!" directives.&lt;br&gt;Looking inside the file and seeing the #!, I reran the command as&lt;/p&gt;&lt;p&gt;ruby script/runner &lt;a href="http://Demo.run" rel="nofollow noopener" target="_blank" title="Demo.run"&gt;Demo.run&lt;/a&gt;&lt;/p&gt;&lt;p&gt;and got a RuntimeError at demo.rb:29 in 'run':&lt;/p&gt;&lt;p&gt;Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id (RuntimeError)&lt;/p&gt;&lt;p&gt;The directions say to just copy the migrations into the right directory and then run the demo, so I assumed that the demo would invoke rake db:migrate.&lt;/p&gt;&lt;p&gt;This turns out not to be the case.  Here's what worked for me:&lt;/p&gt;&lt;p&gt;1) Copy the data migrations from extras\db\migrate into db\migrate&lt;br&gt;2) rake db:migrate&lt;br&gt;3) ruby script/runner &lt;a href="http://Demo.run" rel="nofollow noopener" target="_blank" title="Demo.run"&gt;Demo.run&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Morris</dc:creator><pubDate>Wed, 05 Nov 2008 16:17:22 -0000</pubDate></item><item><title>Re: Protected: Assignment 3</title><link>http://e168f08.plugh.org/assignment-3/#comment-3556798</link><description>&lt;p&gt;When I run:&lt;/p&gt;&lt;p&gt;ruby lib/schema_comparison.rb&lt;/p&gt;&lt;p&gt;I get:&lt;/p&gt;&lt;p&gt;Checking table 'measurements'&lt;br&gt;Checking table 'observations'&lt;br&gt;  For the 'limit' attribute for column 'amount', expected '8' but you had ''&lt;br&gt;  For the 'precision' attribute for column 'amount', expected '8' but you had ''&lt;br&gt;  For the 'scale' attribute for column 'amount', expected '2' but you had ''&lt;br&gt;  For the 'sql_type' attribute for column 'amount', expected 'decimal(8,2)' but you had 'decimal'&lt;br&gt;  For the 'limit' attribute for column 'notes', expected '' but you had '255'&lt;br&gt;  For the 'sql_type' attribute for column 'notes', expected 'text' but you had 'varchar(255)'&lt;br&gt;  For the 'type' attribute for column 'notes', expected 'text' but you had 'string'&lt;br&gt;Checking table 'observation_sets'&lt;br&gt;Checking table 'observation_kinds'&lt;br&gt;Checking table 'units'&lt;br&gt;Checking table 'users'&lt;br&gt;Checking table 'rollups'&lt;/p&gt;&lt;p&gt;I've checked over my create table migration for 'observations' to make sure they match the schema and I don't see anything different from the other migrations. Also, when I run rake test:units I don't get any Failures or Errors and script/runner "&lt;a href="http://Demo.run" rel="nofollow noopener" target="_blank" title="Demo.run"&gt;Demo.run&lt;/a&gt;" gives me the result listed above. How do I fix the issues with the 'observations' table?&lt;/p&gt;&lt;p&gt;Thanks.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anita</dc:creator><pubDate>Wed, 05 Nov 2008 14:37:55 -0000</pubDate></item><item><title>Re: Protected: Assignment 3</title><link>http://e168f08.plugh.org/assignment-3/#comment-3548774</link><description>&lt;p&gt;Three suggestions:&lt;/p&gt;&lt;p&gt;(1) The error -- meaning that the test can't run because an unexpected exception is being thrown -- is worth checking because sometimes such errors can be clues to why the failures are happening.&lt;/p&gt;&lt;p&gt;(2) Write a separate little class and put it in the lib/ directory. Put the code that manipulates the models into a class method. For instance you might call the class CheckLogin and the method tryit:&lt;/p&gt;&lt;p&gt;class CheckLogin&lt;br&gt;  def self.tryit&lt;br&gt;    u = &lt;a href="http://User.new" rel="nofollow noopener" target="_blank" title="User.new"&gt;User.new&lt;/a&gt;(:login = 'somethingunusual')&lt;br&gt;    &lt;a href="http://u.save" rel="nofollow noopener" target="_blank" title="u.save"&gt;u.save&lt;/a&gt;!&lt;br&gt;  end&lt;br&gt;end&lt;/p&gt;&lt;p&gt;To run a program like this in lib/ use script/runner from the root:&lt;/p&gt;&lt;p&gt;script/runner "CheckLogin.tryit"&lt;/p&gt;&lt;p&gt;NOTE: This will try it against your development database.&lt;/p&gt;&lt;p&gt;Run it twice. The first time it should work because there is no user with the login 'somethingunusual'; the 2nd time it should not pass the validation because the login already exists.&lt;/p&gt;&lt;p&gt;if this sequences either fails the first run, or works the 2nd time, then you need to review your code.&lt;/p&gt;&lt;p&gt;(3) You might try removing your development database altogether (rm db/development.sqlite3) and running the migrations all over. Note that the 02 migration is slow. Then run the schema comparison again, and then the tests. It can happen that you've put something into the dev database that isn't getting removed during your "down" migrations, and this is screwing something up.&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>Wed, 05 Nov 2008 05:44:48 -0000</pubDate></item><item><title>Re: Protected: Assignment 3</title><link>http://e168f08.plugh.org/assignment-3/#comment-3547052</link><description>&lt;p&gt;I have two failures and one error remaining. The two failures are nearly identical, and so I am looking for help on the first one:&lt;br&gt;  1) Failure:test_0020_new(UserTest)&lt;br&gt;    [./test/unit/user_test.rb:14:in `test_0020_new'&lt;br&gt;     c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/testing/setup_and_teardown.rb:33:in `__send__'&lt;br&gt;     c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/testing/setup_and_teardown.rb:33:in `run']:&lt;br&gt;&amp;lt;false&amp;gt; is not true.&lt;/p&gt;&lt;p&gt;I am validating the format of "login", and that "login" and "name" are unique, but those do not help... maybe they are the problem.&lt;/p&gt;&lt;p&gt;Please assist.&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">swithin</dc:creator><pubDate>Wed, 05 Nov 2008 02:13:26 -0000</pubDate></item><item><title>Re: Protected: Assignment 3</title><link>http://e168f08.plugh.org/assignment-3/#comment-3489993</link><description>&lt;p&gt;What was it?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jgn</dc:creator><pubDate>Tue, 04 Nov 2008 12:44:35 -0000</pubDate></item><item><title>Re: Protected: Assignment 3</title><link>http://e168f08.plugh.org/assignment-3/#comment-3489385</link><description>&lt;p&gt;You might have manually added a Measurement with :name =&amp;gt; nil by accident? Something like that?&lt;/p&gt;&lt;p&gt;Hmm, or maybe the Demo app is conflicting. Did you run the Demo app first, and then the final migrations?&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jgn</dc:creator><pubDate>Tue, 04 Nov 2008 12:26:25 -0000</pubDate></item><item><title>Re: Protected: Assignment 3</title><link>http://e168f08.plugh.org/assignment-3/#comment-3489275</link><description>&lt;p&gt;I resolved the issue. Thank you.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">student</dc:creator><pubDate>Tue, 04 Nov 2008 12:20:21 -0000</pubDate></item></channel></rss>