<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
   <title>MyInnoQBlog</title>
   <link rel="alternate" type="text/html" href="http://www.innoq.com/blog/dp/" />
   <link rel="self" type="application/atom+xml" href="http://www.innoq.com/blog/dp/atom.xml" />
   <id>tag:www.innoq.com,2010:/blog/dp/23</id>
   <updated>2008-07-12T18:06:38Z</updated>
   <subtitle>by Daniel Pietzsch</subtitle>
   <generator uri="http://www.sixapart.com/movabletype/">Movable Type 3.31</generator>

<entry>
   <title>Got Backup?</title>
   <link rel="alternate" type="text/html" href="http://www.innoq.com/blog/dp/2008/07/got_backup.html" />
   <id>tag:www.innoq.com,2008:/blog/dp//23.3479</id>
   
   <published>2008-07-12T18:05:36Z</published>
   <updated>2008-07-12T18:06:38Z</updated>
   
   <summary>On thursday morning, my hard drive died at the age of (almost) 4. I&amp;#8217;m really glad I&amp;#8217;m backing up my data every hour. So the whole process of getting everything up and running again was really inconvenient, but was no...</summary>
   <author>
      <name>Daniel</name>
      <uri>http://www.innoq.com/blog/dp/</uri>
   </author>
         <category term="About" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="de" xml:base="http://www.innoq.com/blog/dp/">
      <![CDATA[On thursday morning, my hard drive died at the age of (almost) 4. I'm really glad I'm backing up my data every hour. So the whole process of getting everything up and running again was really inconvenient, but was no catastrophe!

For 58€ my disc space is now doubled (160GB now) and I had the opportunity to have a look inside my Powerbook. ;-)

<a href="http://www.flickr.com/photos/pie4dan/2660834911/" title="Got Backup? by pie4dan, on Flickr"><img src="http://farm4.static.flickr.com/3213/2660834911_bb5e4b64f3.jpg" width="500" height="333" alt="Got Backup?" /></a>

So: don't be careless and backup regularly!]]>
      
   </content>
</entry>
<entry>
   <title>Status</title>
   <link rel="alternate" type="text/html" href="http://www.innoq.com/blog/dp/2008/07/status.html" />
   <id>tag:www.innoq.com,2008:/blog/dp//23.3478</id>
   
   <published>2008-07-11T15:09:29Z</published>
   <updated>2008-07-11T15:12:00Z</updated>
   
   <summary>It&amp;#8217;s been a long time since I last updated the blog. I have been really busy creating the in-house application (here at innoq) for invoice management and time reporting. And as this is my diploma thesis, too, I&amp;#8217;m now occupied...</summary>
   <author>
      <name>Daniel</name>
      <uri>http://www.innoq.com/blog/dp/</uri>
   </author>
         <category term="Dev" scheme="http://www.sixapart.com/ns/types#category" />
         <category term="Diploma" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="de" xml:base="http://www.innoq.com/blog/dp/">
      <![CDATA[It's been a long time since I last updated the blog. I have been really busy creating the in-house application (here at [innoq](http://innoq.com)) for invoice management and time reporting. And as this is my diploma thesis, too, I'm now occupied with writing the thesis.

*"innoVoice"*: that's the title of the application (or at least the working title).  
The app is now up and running for approx. 50 days and is in production mode concerning the management of invoices. The time reporting part is being tested by co-workers this month.

As you may have followed [my](http://www.innoq.com/blog/dp/2008/02/first_ui_mockup_1.html "First UI mockup (MyInnoQBlog)") [design](http://www.innoq.com/blog/dp/2008/02/second_ui_mockup.html "Second UI mockup (MyInnoQBlog)") [mockups](http://www.innoq.com/blog/dp/2008/02/third_and_probably_last_time_r.html "Third (and probably last) time reporting mockup (MyInnoQBlog)") of the time reporting screen, I thought I'd share the (for now) final design:

<a href="http://www.innoq.com/blog/dp/2008-07-11_final_design.png"><img src="http://www.innoq.com/blog/dp/2008-07-11_final_design.png" width="500" height="390"></a>

Note to self: I should update this blog more regularly!]]>
      
   </content>
</entry>
<entry>
   <title>Lesson learned</title>
   <link rel="alternate" type="text/html" href="http://www.innoq.com/blog/dp/2008/04/lesson_learned.html" />
   <id>tag:www.innoq.com,2008:/blog/dp//23.3459</id>
   
   <published>2008-04-29T18:30:30Z</published>
   <updated>2008-04-29T18:31:36Z</updated>
   
   <summary>A part of my ER-Model is not correct: The many-to-many association between Projects and Users is simply wrong. Imagine a simple case of an deletion of a relation between an User and a Project - for example the user/employee stopped...</summary>
   <author>
      <name>Daniel</name>
      <uri>http://www.innoq.com/blog/dp/</uri>
   </author>
         <category term="Dev" scheme="http://www.sixapart.com/ns/types#category" />
         <category term="Diploma" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="de" xml:base="http://www.innoq.com/blog/dp/">
      <![CDATA[A part of my ER-Model is not correct:

<a href="http://www.innoq.com/blog/dp/2008-04-29_er_diagramm_ausschnitt_wrong.png"><img src="http://www.innoq.com/blog/dp/2008-04-29_er_diagramm_ausschnitt_wrong.png" width="500" height="206" title="Click to view bigger"></a>

The many-to-many association between _Projects_ and _Users_ is simply wrong. Imagine a simple case of an deletion of a relation between an _User_ and a _Project_ - for example the user/employee stopped working on that particular project - causes the project also to disappear from _Timereports_ in the past.  
And this is fundamentally wrong, **because he surely did work on that project**!

And so the connection should be between _Projects_ and _Timereports_!!! Like this:

<a href="http://www.innoq.com/blog/dp/2008-04-29_er_diagramm_ausschnitt_right.png"><img src="http://www.innoq.com/blog/dp/2008-04-29_er_diagramm_ausschnitt_right.png" width="500" height="162" title="Click to view bigger"></a>

I'm pretty sure this has to be modelled this way.  
Now if the user stops working on a particular project, it's no problem to do that deletion.

	Project has_many :timereports, :through => :projects_timereports
	######
	Timereport has_many :projects, :through => :projects_timereports
	######
	ProjectsTimereports has_many :timereportentries
	
Ok, now I'll have to re-code that and I hope it won't me drive nuts to do this, because I really could have avoided it!]]>
      
   </content>
</entry>
<entry>
   <title>ActiveResource and Associations</title>
   <link rel="alternate" type="text/html" href="http://www.innoq.com/blog/dp/2008/04/activeresource_and_association.html" />
   <id>tag:www.innoq.com,2008:/blog/dp//23.3458</id>
   
   <published>2008-04-23T18:39:50Z</published>
   <updated>2008-04-23T18:47:10Z</updated>
   
   <summary>Ok, it&amp;#8217;s been quite a while since the last post popped up here; that&amp;#8217;s because I struggled with the innoQ internal timereporting- and invoicing-application I&amp;#8217;m working on, which is my diploma thesis, too. And here&amp;#8217;s one of my problems I...</summary>
   <author>
      <name>Daniel</name>
      <uri>http://www.innoq.com/blog/dp/</uri>
   </author>
         <category term="Dev" scheme="http://www.sixapart.com/ns/types#category" />
         <category term="Diploma" scheme="http://www.sixapart.com/ns/types#category" />
         <category term="Ruby on Rails" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="299" label="ActiveRecord" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="297" label="ActiveResource" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="301" label="Associations" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="306" label="habtm" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="307" label="has_many" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="302" label="join" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="305" label="many-to-many" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="303" label="model" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="78" label="rails" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="43" label="Ruby" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="308" label="RubyOnRails" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="de" xml:base="http://www.innoq.com/blog/dp/">
      <![CDATA[Ok, it's been quite a while since the last post popped up here; that's because I struggled with the innoQ internal timereporting- and invoicing-application I'm working on, which is my diploma thesis, too.  
And here's one of my problems I had...

### Preface

Concerning users that are going to use my application, there has been a change made, so my app is no longer responsible for user management. This is now all done by a separate application. And this applications has a REST interface which I have access to and should obtain my user data from, as well as handle authentication.
I now look at the "obtain data" part, because the authentication part is definitely worth another blog post.

### ActiveResource basics

Now: receiving data from another Rails app with a REST interface is quite simple. In the model (in my case _User_) you inherit from _ActiveResource::Base_ instead of _ActiveRecord::Base_ and specify a site url to the remote Rails application. Like this:

    class User < ActiveResource::Base
		self.site = "http://the.url.to/yourapp/"
	end
	
Now you can obtain user data almost the same way you do with _ActiveRecord_ classes:

	User.find(2) # finds the user with the id of '2'
	
or even

	User.find(:all) # finds all users in the remote app
	
if you like.

### My problem

But what if your resource is somehow associated with your local model and database?  
In my case an _user_ has many _projects_ and a _project_ has many _users_. So here you have a many-to-many relationship.

That really is more difficult for problems like "I'd like to obtain all users for a specific project" and vice versa, because you can't just make up a many-to-many relationship as you would with two ActiveRecord objects. Like this:

	has_and_belongs_to_many :projects # or
	has_many :projects, :through => 'projects_users'
	
In a class which inherits from ActiveResource this is not supported/allowed.  
Ok, in my _project_ model these statements would work, because it is an ActiveRecord object. But all the methods you gain through this won't work either, because they don't know the you are referencing a model of type ActiveResource and all finds will fail.

So what to do?  
Here's what works for me (so far).  
But I'm sure there are many more ways out there to solve this, and I'd really appriciate every comment on this topic, 'cause I am curious if there's a more elegant solution. So, there you go:

### My solution

Remember the initial situation:

Project (ActiveRecord - in my app) (M)-----------(has)----------(N) User (ActiveResource - remote app)

So first of all I created a join table and the corresponding join model by typing (in the console, of course):

	script/generate model projects_users
	
This creates a model for me with along with a migration file. Inside this file I write these lines:

	class CreateProjectsUsers < ActiveRecord::Migration
	  def self.up
	    create_table :projects_users do |t|
	      t.integer :project_id, :user_id, :null => false
	      t.string :color, :null => false
	    end
	  end

	  def self.down
	    drop_table :projects_users
	  end
	end
	
An advantage of join models is that you can store additional attributes in the join table. The only thing I store along the _project\_id_ and the _user\_id_ is a _color_. That's just relevant for the front-end to display the project in the correct color, so don't get irritated. ;-)

Then, I ran the migration:

	rake db:migrate
	
Now, let's head over to the association part.  
As you can't put any associations in a ActiveResource model, there's nothing to do in the _User_ model.

In the _Project_ model I put a _has\_many_ statement:

	has_many :projects_users, :class_name => "ProjectsUsers"
	
(Note, that in my case I had to explicitly tell the _class\_name_ of the join model class, because Rails assumes this to be singular, i.e. _ProjectUser_.)

In the _ProjectsUsers_ model I wrote the following two lines:

	belongs_to :project
	belongs_to :user # so far this isn't used by me, but it may be useful some day
	
Now the interesting part: How can you get all users for a given project in a way like _project.users.find(:all)_?  
In _project.rb_, define a method called _users_:

	def users
    	user_ids = self.projects_users.find(:all, :select => "user_id")
    	users = user_ids.collect { |projects_users| User.find(projects_users.user_id) }
	end
	
Now via _project.users_ you'll get all the users you need.  
(I'm pretty sure you can rewrite this, so that it works the _railsway_ and you can call _project.users.find(:all)_ instead, but I haven't tried it, yet)

Ok, the other way round, meaning obtaining all projects for a specific user, I faked it a bit, and I'm sure you can do better here, too. But it works!  
Instead of creating a _projects_ method in the _User_ model, I coded a method called _self.find\_by\_user\_id_ in the _Projects_ model:

	def self.find_by_user_id(userid)
    	project_ids = ProjectsUsers.find_all_by_user_id(userid, :select => "project_id")
    	projects = project_ids.collect { |projects_users| projects_users.project }
	end
	
You can call it this way:

	user_projects = Project.find_by_user_id(2)
	
And _BOOM!_, you have all projects for the user no. 2.

That's all folks!
This was my solution/workaround for integrating a REST-Resource via a many-to-many association in Rails. Hope you liked it. :-)]]>
      
   </content>
</entry>
<entry>
   <title>Rails and in_place_editor issues</title>
   <link rel="alternate" type="text/html" href="http://www.innoq.com/blog/dp/2008/04/rails_and_in_place_editor_issu.html" />
   <id>tag:www.innoq.com,2008:/blog/dp//23.3454</id>
   
   <published>2008-04-05T14:58:40Z</published>
   <updated>2008-04-05T15:16:48Z</updated>
   
   <summary>Ok, so the last few days I had a bit of a struggle concerning the script.aculo.us in place editor and the corresponding plugin/helper in rails. So here are my links that really helped me solving these issues: InPlaceEditing in Ruby...</summary>
   <author>
      <name>Daniel</name>
      <uri>http://www.innoq.com/blog/dp/</uri>
   </author>
         <category term="Dev" scheme="http://www.sixapart.com/ns/types#category" />
         <category term="Diploma" scheme="http://www.sixapart.com/ns/types#category" />
         <category term="Ruby on Rails" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="295" label="errors" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="294" label="in_place_editor" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="78" label="rails" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="de" xml:base="http://www.innoq.com/blog/dp/">
      <![CDATA[Ok, so the last few days I had a bit of a struggle concerning the [script.aculo.us in place editor](http://wiki.script.aculo.us/scriptaculous/show/Ajax.InPlaceEditor) and the corresponding [plugin](http://dev.rubyonrails.org/browser/plugins/in_place_editing "/plugins/in_place_editing - Rails Trac - Trac")/helper in rails.  
So here are my links that really helped me solving these issues:

* [InPlaceEditing in Ruby on Rails](http://wiki.rubyonrails.org/rails/pages/InPlaceEditing "InPlaceEditing in Ruby on Rails") (in case you get an error like *"Called id for nil, which would mistakenly be 4—if you really wanted the id of nil, use object_id"*)
* [in\_place\_edit\_for, in\_place\_editor\_field and Complex Cases](http://www.postal-code.com/binarycode/2007/04/13/in_place_edit_for-in_place_editor_field-and-complex-cases/ "Binary Code &raquo; in_place_edit_for, in_place_editor_field and Complex Cases") (if it's not the 'standard' way you want to use the editor for) and
* [can't get in\_place\_edit to work in rails 2.0](http://www.ruby-forum.com/topic/136093 "can't get in_place_edit to work in rails 2.0 =&gt; ActionController::InvalidAuthenticityToken - Ruby Forum") (if you use cookie based session data and turned on the *protect\_from\_forgery* secret key; actually the 'solution' given in this thread is more a workaround - but useful anyway)

If you have more interesting links regarding the in\_place\_editor and rails, feel free to leave a comment right here. Thanks.]]>
      
   </content>
</entry>
<entry>
   <title>Euruko this weekend! [UPDATE]</title>
   <link rel="alternate" type="text/html" href="http://www.innoq.com/blog/dp/2008/03/euruko_this_weekend_update.html" />
   <id>tag:www.innoq.com,2008:/blog/dp//23.3443</id>
   
   <published>2008-03-27T19:32:39Z</published>
   <updated>2008-03-30T15:19:50Z</updated>
   
   <summary>This weekend the Euruko conference takes place in Prague. It&apos;s all about Ruby and I&apos;ll gonna be there. I&apos;m quite excited, as this is my first (big) conference I&apos;m going to attend. I think most of the talks will be...</summary>
   <author>
      <name>Daniel</name>
      <uri>http://www.innoq.com/blog/dp/</uri>
   </author>
         <category term="About" scheme="http://www.sixapart.com/ns/types#category" />
         <category term="Ruby" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="293" label="euruko2008" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="43" label="Ruby" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="de" xml:base="http://www.innoq.com/blog/dp/">
      <![CDATA[This weekend the <a href="http://www.euruko2008.org/">Euruko conference</a> takes place in Prague. It's all about Ruby and I'll gonna be there.  
I'm quite excited, as this is my first (big) conference I'm going to attend. I think most of <a href="http://www.euruko2008.org/pages/2-program">the talks</a> will be pretty advanced for a Ruby beginner like me, but I think I won't get dumber... ;-)

Unfortunately we'll probably miss Matz' Keynote, because our flight arrives at 09:30 in the morning and to think we'll be in the center of Prague at 10 o'clock would be really optimistic...

**[UPDATE]**
We managed to get to prague university almost in time, so we saw most of the keynote:

<a href="http://www.flickr.com/photos/pie4dan/2372845245/" title="Venue by pie4dan, on Flickr"><img src="http://farm4.static.flickr.com/3269/2372845245_dee9184d0e.jpg" width="500" height="333" alt="Venue" /></a>

I'm also looking forward to visiting Prague again, 'cause it really is a beautiful city - and affordable, too. That's why I'll stay until late tuesday. :-)]]>
      
   </content>
</entry>
<entry>
   <title>More ER-Modelling</title>
   <link rel="alternate" type="text/html" href="http://www.innoq.com/blog/dp/2008/03/more_ermodelling_1.html" />
   <id>tag:www.innoq.com,2008:/blog/dp//23.3435</id>
   
   <published>2008-03-11T12:19:54Z</published>
   <updated>2008-03-11T12:21:49Z</updated>
   
   <summary>Once more, I improved the model of my application. I wasn&amp;#8217;t satisfied with the fact, that I was indeed able to store the time report data for each day of the month, but have an UI on a monthly basis...</summary>
   <author>
      <name>Daniel</name>
      <uri>http://www.innoq.com/blog/dp/</uri>
   </author>
         <category term="Dev" scheme="http://www.sixapart.com/ns/types#category" />
         <category term="Diploma" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="de" xml:base="http://www.innoq.com/blog/dp/">
      <![CDATA[Once more, I improved the model of my application. I wasn't satisfied with the fact, that I was indeed able to store the time report data for each day of the month, but have an [UI](http://www.innoq.com/blog/dp/2008/02/third_and_probably_last_time_r.html "Third (and probably last) time reporting mockup (MyInnoQBlog)") on a monthly basis and so **one** screen for multiple *DailyReports*.  
Now I modelled it the way, that I have a (monthly) *TimeReport* which has many *DailyReports*. This way a *DailyReport* belongs to a *Project* and a (monthly) *TimeReport*. And a *TimeReport* belongs to a specific user/employee.

<a href="http://www.innoq.com/blog/dp/2008-03-11_er_model_v07_excerpt.png"><img src="http://www.innoq.com/blog/dp/2008-03-11_er_model_v07_excerpt.png" width="500" height="230"></a>

That's exactly how I wanted it to be from the beginning. I don't no why this took me this long...

Now it's also no problem to get nice URLs for a *TimeReport*. For example like this: *http://.../TimeReport/DanielPietzsch/2008/3/* for March 2008.]]>
      
   </content>
</entry>
<entry>
   <title>Third (and probably last) time reporting mockup</title>
   <link rel="alternate" type="text/html" href="http://www.innoq.com/blog/dp/2008/02/third_and_probably_last_time_r.html" />
   <id>tag:www.innoq.com,2008:/blog/dp//23.3430</id>
   
   <published>2008-02-28T17:27:54Z</published>
   <updated>2008-02-28T17:29:10Z</updated>
   
   <summary>Besides thinking about how to model my database I continued working on the UI: Ok, maybe you don&amp;#8217;t see that much difference since the last mockup, but I refined most of the div-structure beneath the surface and did some minor...</summary>
   <author>
      <name>Daniel</name>
      <uri>http://www.innoq.com/blog/dp/</uri>
   </author>
         <category term="Dev" scheme="http://www.sixapart.com/ns/types#category" />
         <category term="Diploma" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="287" label="calendar" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="288" label="mockup" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="de" xml:base="http://www.innoq.com/blog/dp/">
      <![CDATA[Besides [thinking about how to model my database](http://www.innoq.com/blog/dp/2008/02/altered_ermodel.html "Altered ER-Model (MyInnoQBlog)") I continued working on the UI:

<a href="http://www.innoq.com/blog/dp/2008-02-28_time_reporting_mockup_3.png"><img src="http://www.innoq.com/blog/dp/2008-02-28_time_reporting_mockup_3.png" width="500" height="370" /></a>

Ok, maybe you don't see that much difference since the last mockup, but I refined most of the div-structure beneath the surface and did some minor design changes.  
But the biggest improvement is, that the calendar is now based on real dates. I must admit that the [calendar helper plugin](http://agilewebdevelopment.com/plugins/calendar_helper "Plugins - Calendar Helper - Agile Web Development") helped me with the code.

The bullet-points on the 28th are a representation for all calendar fields, where you entered any hours. If you didn't enter an other number than *0* the day cell stays empty (for display). If you want the add or modify hours on a particular day, you click the cell and via an in-place editor you can enter your information. (That's the plan).

I'm not quite sure if the coloring of the weekends will stay that way...I think I'll decide later, since this is not the most important decision to make.

Now I think I should concentrate on the real app, meaning all the functionality and model behind the UI.]]>
      
   </content>
</entry>
<entry>
   <title>Altered ER-Model [UPDATE]</title>
   <link rel="alternate" type="text/html" href="http://www.innoq.com/blog/dp/2008/02/altered_ermodel_update.html" />
   <id>tag:www.innoq.com,2008:/blog/dp//23.3427</id>
   
   <published>2008-02-26T14:08:03Z</published>
   <updated>2008-03-04T17:46:59Z</updated>
   
   <summary>I altered a part of my ER-Model concerning the implementation of the time-reporting: There&amp;#8217;s no longer an entity called &amp;#8220;Arbeitszeit&amp;#8221; (working time). All the worked hours and days should now get stored in the extra many-to-many-table that&amp;#8217;ll be created in...</summary>
   <author>
      <name>Daniel</name>
      <uri>http://www.innoq.com/blog/dp/</uri>
   </author>
         <category term="Dev" scheme="http://www.sixapart.com/ns/types#category" />
         <category term="Diploma" scheme="http://www.sixapart.com/ns/types#category" />
         <category term="Ruby on Rails" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="de" xml:base="http://www.innoq.com/blog/dp/">
      <![CDATA[I altered a part of [my ER-Model](http://www.innoq.com/blog/dp/2007/08/erdiagramm_bestellungenauftrag.html "ER-Diagramm: Bestellungen/Aufträge (MyInnoQBlog)") concerning the implementation of the time-reporting:

<a href="http://www.innoq.com/blog/dp/2008-02-26_er_modell_excerpt.png"><img src="http://www.innoq.com/blog/dp/2008-02-26_er_modell_excerpt.png" width="500" height="221" /></a>

There's no longer an entity called "Arbeitszeit" (working time). All the worked hours and days should now get stored in the extra many-to-many-table that'll be created in between "Stundenzettel" (timesheet) and "Projekt" (project). That table might have the following attributes: *StundenzettelID, ProjektID, workingTimeTotal, dailyTimes, notes*.  
So far I'm not sure how to store all the hours to their corresponding days in *dailyTimes* (because that's at least about 30 values every month and user), but I might use a plain text field which contains a somehow-delimited list of working-hours (ascending from the 1st to the last day of the month).

The "Mitarbeiter" (co-worker) entity is also the applications entity for storing login- and user-information.

What you see on the [latest mockup](http://www.innoq.com/blog/dp/2008/02/second_ui_mockup.html "Second UI mockup (MyInnoQBlog)"), is in Rails the update- or new-action/view for the "Stundenzettel"-controller. I think there won't be any implementation of a read- or delete-action for "Stundenzettel" (timesheets).

So, I hope this will work for me...

And yes, next time the ER-Model will be in english, too, that I don't have to bother you (and me) with this language mix. I also code in english, so this makes sense anyway.

[UPDATE]

After talking to [Tim](http://innoq.com/blog/tk/) and [Phillip ](http://ghadir.de/blog/) *and* considering [Stefans Comment](http://www.innoq.com/blog/dp/2008/02/altered_ermodel.html#comment-251726), I think this is the right way of modelling the Entity Relationship:

<a href="http://www.innoq.com/blog/dp/ER-Diagramm%20V0.6%20Ausschnitt.png"><img src="http://www.innoq.com/blog/dp/ER-Diagramm%20V0.6%20Ausschnitt.png" width="500" height="224" /></a>

So, in the *DailyReport* entity there is the attribute *Date* which is an additional primary key to the *ProjectID* and the *UserID*. This way the *WorkedHours* are stored for every day. So you have a table for every day, employee and project.  
The same with *notes*. This may be useful to describe your tasks on that day, for example. This way I think I'll have to reengineer the UI, 'cause notes do not get stored on a monthly basis. I already have something in mind for that.

[/UPDATE]]]>
      
   </content>
</entry>
<entry>
   <title>Second UI mockup</title>
   <link rel="alternate" type="text/html" href="http://www.innoq.com/blog/dp/2008/02/second_ui_mockup.html" />
   <id>tag:www.innoq.com,2008:/blog/dp//23.3424</id>
   
   <published>2008-02-22T17:52:41Z</published>
   <updated>2008-02-22T17:53:25Z</updated>
   
   <summary>The second mockup of the applications UI. I thought I stick to the design of innoq.com, so co-workers are somehow familiar with the layout. The (div-)structure underneath is quite different than the one of innoq.com, but I copied some design-elements...</summary>
   <author>
      <name>Daniel</name>
      <uri>http://www.innoq.com/blog/dp/</uri>
   </author>
         <category term="Dev" scheme="http://www.sixapart.com/ns/types#category" />
         <category term="Diploma" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="de" xml:base="http://www.innoq.com/blog/dp/">
      <![CDATA[The second mockup of the applications UI. I thought I stick to the design of [innoq.com](http://innoq.com/), so co-workers are somehow familiar with the layout. The (div-)structure underneath is quite different than the one of innoq.com, but I copied some design-elements so far.

Take a look:

<a href="http://www.innoq.com/blog/dp/2008-02-22_time_reporting_2.png"><img src="http://www.innoq.com/blog/dp/2008-02-22_time_reporting_2.png" width="500" height="370" /></a>

In the top-right corner you now have the ability to add one or more projects you're currently working on. They'll be differentiated by colors. In the calendar you'll find the corresponding fields for these projects. Again: I think I'll hide most of these field in normal view, using an in-place editor.

I'm still really curious what your opinion is...]]>
      
   </content>
</entry>
<entry>
   <title>First UI mockup</title>
   <link rel="alternate" type="text/html" href="http://www.innoq.com/blog/dp/2008/02/first_ui_mockup_1.html" />
   <id>tag:www.innoq.com,2008:/blog/dp//23.3422</id>
   
   <published>2008-02-18T15:47:02Z</published>
   <updated>2008-02-18T15:53:22Z</updated>
   
   <summary>As far as Unified Process is concerned, I already clarified some of the Business Modeling and Requirements a few month ago. See my blogposts here and here. Well, I think I had a flash of inspiration: in order to &amp;#8220;get...</summary>
   <author>
      <name>Daniel</name>
      <uri>http://www.innoq.com/blog/dp/</uri>
   </author>
         <category term="Dev" scheme="http://www.sixapart.com/ns/types#category" />
         <category term="Diploma" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="de" xml:base="http://www.innoq.com/blog/dp/">
      <![CDATA[As far as [Unified Process](http://de.wikipedia.org/wiki/Rational_Unified_Process "Rational Unified Process - Wikipedia") is concerned, I already clarified some of the Business Modeling and Requirements a few month ago. See my blogposts [here](http://www.innoq.com/blog/dp/2007/08/erdiagramm_bestellungenauftrag.html "ER-Diagramm: Bestellungen/Aufträge (MyInnoQBlog)") and [here](http://www.innoq.com/blog/dp/2007/07/usecase_diagramm_nachste_versi.html "Use-Case Diagramm: nächste Version (MyInnoQBlog)").

Well, I think I had a flash of inspiration: in order to "[get real](http://gettingreal.37signals.com/ "Getting Real: The Book by 37signals")" I decided to start with the project. Isn't that great?  
And I decided to go with the UI first, because the first thing that comes to my mind is how the app will roughly look like. As a working title I called the app "innoVoice" (Yeah, it really *is* a great pun *\*cough\**)

There you go:

<a href="http://www.innoq.com/blog/dp/2008-02-18_time_reporting.png"><img src="http://www.innoq.com/blog/dp/2008-02-18_time_reporting.png" width="500" height="380" /></a>

That is the first screen for the colleagues out there in customer-projects for doing their time-reporting.  
Ok, it is still made up of standard fonts, there are no fancy graphics etc., but I think it represents the image I have in mind when I think of that part of the app.  
What bothers me a bit are all the input fields in the calendar. I think I'll hide them using some AJAX in-place editors, so they won't be that distracting.

I don't really know what will be next. Either I start implementing this feature or I go for another UI-mockup. Maybe I'll know more in one hour or so...

Stay tuned and feel free\* to comment on the UI-mockup!

<small>\*actually, I would force you to comment, if I could!</small>]]>
      
   </content>
</entry>
<entry>
   <title>Preface</title>
   <link rel="alternate" type="text/html" href="http://www.innoq.com/blog/dp/2008/02/preface.html" />
   <id>tag:www.innoq.com,2008:/blog/dp//23.3421</id>
   
   <published>2008-02-14T13:28:09Z</published>
   <updated>2008-02-14T13:39:09Z</updated>
   
   <summary>The first draft of what my diploma thesis will be about (in german): Arbeitsthese (PDF)...</summary>
   <author>
      <name>Daniel</name>
      <uri>http://www.innoq.com/blog/dp/</uri>
   </author>
         <category term="About" scheme="http://www.sixapart.com/ns/types#category" />
         <category term="Diploma" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="de" xml:base="http://www.innoq.com/blog/dp/">
      <![CDATA[The first draft of what my diploma thesis will be about (in german): <a href="http://www.innoq.com/blog/dp/Arbeitsthese.pdf">Arbeitsthese</a> (PDF)]]>
      
   </content>
</entry>
<entry>
   <title>Years of irrelevance</title>
   <link rel="alternate" type="text/html" href="http://www.innoq.com/blog/dp/2008/02/years_of_irrelevance.html" />
   <id>tag:www.innoq.com,2008:/blog/dp//23.3414</id>
   
   <published>2008-02-05T18:48:51Z</published>
   <updated>2008-02-05T19:03:33Z</updated>
   
   <summary>&quot;Requiring X years of experience on platform Y in your job posting is, well, ignorant.&quot; DHH on the 37signals blog. I found this post really interesting (including the comments). As a student I never applied for a job that required...</summary>
   <author>
      <name>Daniel</name>
      <uri>http://www.innoq.com/blog/dp/</uri>
   </author>
         <category term="Web" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="89" label="37signals" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="278" label="DHH" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="256" label="programming" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="276" label="YOE" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="de" xml:base="http://www.innoq.com/blog/dp/">
      <![CDATA[<blockquote>"Requiring X years of experience on platform Y in your job posting is, well, ignorant."</blockquote>
DHH on the <a href="http://www.37signals.com/svn/posts/833-years-of-irrelevance">37signals blog</a>.

I found this <a href="http://www.37signals.com/svn/posts/833-years-of-irrelevance">post</a> really interesting (including the comments).

As a student I never applied for a job that required X years in experience on a specific platform, but I sometimes wondered how hard employers insist on such a point on a job offer.  
I mean, it really depends on the single person. There a definitely programmers (not to say geeks ;-) ) that are better in programming X after one year of experience than others are after - say - 3 years (IMHO).

What do you think?]]>
      
   </content>
</entry>
<entry>
   <title>Hell yeah! I&apos;m done...</title>
   <link rel="alternate" type="text/html" href="http://www.innoq.com/blog/dp/2008/01/hell_yeah_im_done.html" />
   <id>tag:www.innoq.com,2008:/blog/dp//23.3410</id>
   
   <published>2008-01-30T17:35:30Z</published>
   <updated>2008-01-30T17:45:30Z</updated>
   
   <summary>...with written tests for university! Today i wrote my last and now I can fully concentrate on my diploma thesis (and innoq.com, too). By the way: innoq.com is running on Rails for almost 3 weeks now, and I think it&apos;s...</summary>
   <author>
      <name>Daniel</name>
      <uri>http://www.innoq.com/blog/dp/</uri>
   </author>
         <category term="About" scheme="http://www.sixapart.com/ns/types#category" />
         <category term="Diploma" scheme="http://www.sixapart.com/ns/types#category" />
         <category term="innoq.com" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="274" label="diploma" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="139" label="innoq.com" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="78" label="rails" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="145" label="tests" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="273" label="university" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="de" xml:base="http://www.innoq.com/blog/dp/">
      <![CDATA[...with written tests for university!  
Today i wrote my last and now I can fully concentrate on my diploma thesis (and innoq.com, too). By the way: <a href="http://www.innoq.com">innoq.com</a> is running on Rails for almost 3 weeks now, and I think it's doing fine, isn't it, <a href="http://innoq.com/blog/st/">Stefan</a>?

I think I'll have a beer right now...! Cheers!]]>
      
   </content>
</entry>
<entry>
   <title>Got Math?</title>
   <link rel="alternate" type="text/html" href="http://www.innoq.com/blog/dp/2008/01/got_math.html" />
   <id>tag:www.innoq.com,2008:/blog/dp//23.3372</id>
   
   <published>2008-01-03T09:34:02Z</published>
   <updated>2008-01-03T09:40:41Z</updated>
   
   <summary>Amy Hoy: &quot;No, [math is] not a prerequisite for most programming, and especially not web development as a whole. The more I watch people struggle with programming, the more I think that synthesis and intellectual flexibility are far more important...</summary>
   <author>
      <name>Daniel</name>
      <uri>http://www.innoq.com/blog/dp/</uri>
   </author>
         <category term="Dev" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="1" label="math" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="256" label="programming" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="257" label="skills" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="de" xml:base="http://www.innoq.com/blog/dp/">
      <![CDATA[Amy Hoy:

<blockquote>"No, [math is] not a prerequisite for most programming, and especially not web development as a whole.

The more I watch people struggle with programming, the more I think that synthesis and intellectual flexibility are far more important skills than the ability to write small, isolated, brilliant bits of code."</blockquote>

Really good article and discussion on the link between math and programming skills.  
Be sure to read the very interesting comments as well:

<a href="http://www.slash7.com/articles/2008/1/2/got-math">http://www.slash7.com/articles/2008/1/2/got-math</a>]]>
      
   </content>
</entry>

</feed>
