<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>app/views/demo/fact_list.rhtml</filename>
    </added>
    <added>
      <filename>app/views/layouts/demo.rhtml</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,183 +1,3 @@
-== Welcome to Rails
+== Welcome to ActiveWarehouse Demo
 
-Rails is a web-application and persistence framework that includes everything
-needed to create database-backed web-applications according to the
-Model-View-Control pattern of separation. This pattern splits the view (also
-called the presentation) into &quot;dumb&quot; templates that are primarily responsible
-for inserting pre-built data in between HTML tags. The model contains the
-&quot;smart&quot; domain objects (such as Account, Product, Person, Post) that holds all
-the business logic and knows how to persist themselves to a database. The
-controller handles the incoming requests (such as Save New Account, Update
-Product, Show Post) by manipulating the model and directing data to the view.
-
-In Rails, the model is handled by what's called an object-relational mapping
-layer entitled Active Record. This layer allows you to present the data from
-database rows as objects and embellish these data objects with business logic
-methods. You can read more about Active Record in 
-link:files/vendor/rails/activerecord/README.html.
-
-The controller and view are handled by the Action Pack, which handles both
-layers by its two parts: Action View and Action Controller. These two layers
-are bundled in a single package due to their heavy interdependence. This is
-unlike the relationship between the Active Record and Action Pack that is much
-more separate. Each of these packages can be used independently outside of
-Rails.  You can read more about Action Pack in 
-link:files/vendor/rails/actionpack/README.html.
-
-
-== Getting started
-
-1. Start the web server: &lt;tt&gt;ruby script/server&lt;/tt&gt; (run with --help for options)
-2. Go to http://localhost:3000/ and get &quot;Welcome aboard: You&#8217;re riding the Rails!&quot;
-3. Follow the guidelines to start developing your application
-
-
-== Web servers
-
-Rails uses the built-in web server in Ruby called WEBrick by default, so you don't
-have to install or configure anything to play around. 
-
-If you have lighttpd installed, though, it'll be used instead when running script/server.
-It's considerably faster than WEBrick and suited for production use, but requires additional
-installation and currently only works well on OS X/Unix (Windows users are encouraged
-to start with WEBrick). We recommend version 1.4.11 and higher. You can download it from
-http://www.lighttpd.net.
-
-If you want something that's halfway between WEBrick and lighttpd, we heartily recommend
-Mongrel. It's a Ruby-based web server with a C-component (so it requires compilation) that
-also works very well with Windows. See more at http://mongrel.rubyforge.org/.
-
-But of course its also possible to run Rails with the premiere open source web server Apache.
-To get decent performance, though, you'll need to install FastCGI. For Apache 1.3, you want
-to use mod_fastcgi. For Apache 2.0+, you want to use mod_fcgid.
-
-See http://wiki.rubyonrails.com/rails/pages/FastCGI for more information on FastCGI.
-
-== Example for Apache conf
-
-  &lt;VirtualHost *:80&gt;
-    ServerName rails
-    DocumentRoot /path/application/public/
-    ErrorLog /path/application/log/server.log
-  
-    &lt;Directory /path/application/public/&gt;
-      Options ExecCGI FollowSymLinks
-      AllowOverride all
-      Allow from all
-      Order allow,deny
-    &lt;/Directory&gt;
-  &lt;/VirtualHost&gt;
-
-NOTE: Be sure that CGIs can be executed in that directory as well. So ExecCGI
-should be on and &quot;.cgi&quot; should respond. All requests from 127.0.0.1 go
-through CGI, so no Apache restart is necessary for changes. All other requests
-go through FCGI (or mod_ruby), which requires a restart to show changes.
-
-
-== Debugging Rails
-
-Have &quot;tail -f&quot; commands running on both the server.log, production.log, and
-test.log files. Rails will automatically display debugging and runtime
-information to these files. Debugging info will also be shown in the browser
-on requests from 127.0.0.1.
-
-
-== Breakpoints
-
-Breakpoint support is available through the script/breakpointer client. This
-means that you can break out of execution at any point in the code, investigate
-and change the model, AND then resume execution! Example:
-
-  class WeblogController &lt; ActionController::Base
-    def index
-      @posts = Post.find_all
-      breakpoint &quot;Breaking out from the list&quot;
-    end
-  end
-  
-So the controller will accept the action, run the first line, then present you
-with a IRB prompt in the breakpointer window. Here you can do things like:
-
-Executing breakpoint &quot;Breaking out from the list&quot; at .../webrick_server.rb:16 in 'breakpoint'
-
-  &gt;&gt; @posts.inspect
-  =&gt; &quot;[#&lt;Post:0x14a6be8 @attributes={\&quot;title\&quot;=&gt;nil, \&quot;body\&quot;=&gt;nil, \&quot;id\&quot;=&gt;\&quot;1\&quot;}&gt;, 
-       #&lt;Post:0x14a6620 @attributes={\&quot;title\&quot;=&gt;\&quot;Rails you know!\&quot;, \&quot;body\&quot;=&gt;\&quot;Only ten..\&quot;, \&quot;id\&quot;=&gt;\&quot;2\&quot;}&gt;]&quot;
-  &gt;&gt; @posts.first.title = &quot;hello from a breakpoint&quot;
-  =&gt; &quot;hello from a breakpoint&quot;
-
-...and even better is that you can examine how your runtime objects actually work:
-
-  &gt;&gt; f = @posts.first 
-  =&gt; #&lt;Post:0x13630c4 @attributes={&quot;title&quot;=&gt;nil, &quot;body&quot;=&gt;nil, &quot;id&quot;=&gt;&quot;1&quot;}&gt;
-  &gt;&gt; f.
-  Display all 152 possibilities? (y or n)
-
-Finally, when you're ready to resume execution, you press CTRL-D
-
-
-== Console
-
-You can interact with the domain model by starting the console through script/console. 
-Here you'll have all parts of the application configured, just like it is when the
-application is running. You can inspect domain models, change values, and save to the
-database. Starting the script without arguments will launch it in the development environment.
-Passing an argument will specify a different environment, like &lt;tt&gt;script/console production&lt;/tt&gt;.
-
-To reload your controllers and models after launching the console run &lt;tt&gt;reload!&lt;/tt&gt;
-
-
-
-== Description of contents
-
-app
-  Holds all the code that's specific to this particular application.
-
-app/controllers
-  Holds controllers that should be named like weblog_controller.rb for
-  automated URL mapping. All controllers should descend from
-  ActionController::Base.
-
-app/models
-  Holds models that should be named like post.rb.
-  Most models will descend from ActiveRecord::Base.
-  
-app/views
-  Holds the template files for the view that should be named like
-  weblog/index.rhtml for the WeblogController#index action. All views use eRuby
-  syntax. This directory can also be used to keep stylesheets, images, and so on
-  that can be symlinked to public.
-  
-app/helpers
-  Holds view helpers that should be named like weblog_helper.rb.
-
-app/apis
-  Holds API classes for web services.
-
-config
-  Configuration files for the Rails environment, the routing map, the database, and other dependencies.
-
-components
-  Self-contained mini-applications that can bundle together controllers, models, and views.
-
-db
-  Contains the database schema in schema.rb.  db/migrate contains all
-  the sequence of Migrations for your schema.
-
-lib
-  Application specific libraries. Basically, any kind of custom code that doesn't
-  belong under controllers, models, or helpers. This directory is in the load path.
-    
-public
-  The directory available for the web server. Contains subdirectories for images, stylesheets,
-  and javascripts. Also contains the dispatchers and the default HTML files.
-
-script
-  Helper scripts for automation and generation.
-
-test
-  Unit and functional tests along with fixtures.
-
-vendor
-  External libraries that the application depends on. Also includes the plugins subdirectory.
-  This directory is in the load path.
+This is a demo for the ActiveWarehouse plugin.
\ No newline at end of file</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,13 @@
 class DemoController &lt; ApplicationController
 
   def index
+    render :action =&gt; &quot;demo/index&quot;, :layout =&gt; &quot;application&quot;
+  end
+  def example1
+    
+  end
+  def fact_list
+    @facts = PosRetailSalesTransactionFact.find(
+      :all, :include =&gt; [:date, :store])
   end
 end</diff>
      <filename>app/controllers/demo_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,6 @@
 class PosRetailSalesTransactionFact &lt; ActiveWarehouse::Fact
   define_aggregate :sales_quantity, :type =&gt; :sum
   define_aggregate :sales_dollar_amount, :type =&gt; :sum
+  belongs_to :date, :foreign_key =&gt; 'date_id', :class_name =&gt; 'DateDimension'
+  belongs_to :store, :foreign_key =&gt; 'store_id', :class_name =&gt; 'StoreDimension'
 end
\ No newline at end of file</diff>
      <filename>app/models/pos_retail_sales_transaction_fact.rb</filename>
    </modified>
    <modified>
      <diff>@@ -13,5 +13,8 @@
       &lt;%= image_tag 'example1-erd.png', :alt =&gt; 'Example 1 ERD Diagram' %&gt;
       &lt;p&gt;&lt;%= link_to 'Example #1', :action =&gt; 'example1' %&gt;&lt;/p&gt;
     &lt;/li&gt;
+    &lt;li&gt;
+      &lt;h2&gt;Fact List&lt;/h2&gt;
+      &lt;p&gt;&lt;%= link_to 'Fact List', :action =&gt; 'fact_list' %&gt;&lt;/p&gt;
   &lt;/ol&gt;
 &lt;/div&gt;
\ No newline at end of file</diff>
      <filename>app/views/demo/index.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,9 @@ facts = [
   [300, 3, 1, 1, 'ABC000000002', 1, 1.34, 0.72],
   [600, 3, 1, 1, 'ABC000000003', 2, 2.68, 1.44],
   [1800, 3, 1, 1, 'ABC000000004', 1, 1.34, 0.72],
-  [1, 1, 1, 1, 'DEF000000001', 3, 3.45, 1.56],
+  [1800, 2, 1, 1, 'ABC000000005', 1, 0.94, 0.34],
+  [1801, 1, 1, 1, 'ABC000000006', 2, 2.68, 1.44],
+  [1, 1, 2, 1, 'DEF000000001', 3, 3.45, 1.56],
   [300, 3, 2, 1, 'DEF000000002', 1, 1.34, 0.72],
   [600, 3, 2, 1, 'DEF000000003', 2, 2.68, 1.44],
   [1800, 3, 2, 1, 'DEF000000004', 1, 1.34, 0.72]</diff>
      <filename>db/setup/pos_retail_sales_transaction.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,4 +8,6 @@ select d2.store_name, sum(f.sales_quantity) from pos_retail_sales_transaction_fa
 select d1.calendar_year, d2.store_name, sum(f.sales_quantity) from pos_retail_sales_transaction_facts f join date_dimension d1 on f.date_id = d1.id join store_dimension d2 on f.store_id = d2.id group by d1.calendar_year, d2.store_name;
 
 # This will sum sales quantity and group by calendar year and store region
-select d1.calendar_year, d2.store_region, sum(f.sales_quantity) as sales_quantity from pos_retail_sales_transaction_facts f join date_dimension d1 on f.date_id = d1.id join store_dimension d2 on f.store_id = d2.id group by d1.calendar_year, d2.store_region;
\ No newline at end of file
+select d1.calendar_year, d2.store_region, sum(f.sales_quantity) as sales_quantity from pos_retail_sales_transaction_facts f join date_dimension d1 on f.date_id = d1.id join store_dimension d2 on f.store_id = d2.id group by d1.calendar_year, d2.store_region;
+
+select * from pos_retail_sales_transaction_facts f join date_dimension d1 on f.date_id = d1.id join store_dimension d2 on f.store_id = d2.id;
\ No newline at end of file</diff>
      <filename>doc/expected_queries.txt</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>960477d43d4068cc79a5e38ad7cd92490ef2d55a</id>
    </parent>
  </parents>
  <author>
    <name>aeden</name>
    <email>aeden@78b0de1e-7a20-0410-a083-82450d3afd0a</email>
  </author>
  <url>http://github.com/bcotton/activewarehouse-demo/commit/681951dd08014e7f0d4a6335b0e2c5651c9e279d</url>
  <id>681951dd08014e7f0d4a6335b0e2c5651c9e279d</id>
  <committed-date>2006-11-06T17:07:20-08:00</committed-date>
  <authored-date>2006-11-06T17:07:20-08:00</authored-date>
  <message>Fixes to demo. Added fact list

git-svn-id: svn://rubyforge.org/var/svn/activewarehouse/demo/trunk@47 78b0de1e-7a20-0410-a083-82450d3afd0a</message>
  <tree>2295540095f3f39888ec768a94f5be5dc8b9cbc3</tree>
  <committer>
    <name>aeden</name>
    <email>aeden@78b0de1e-7a20-0410-a083-82450d3afd0a</email>
  </committer>
</commit>
