Rean Griffith wrote:
Hi Amanda,
I attached the file olio-20090729.patch to the email I sent, but maybe
it got stripped off/filtered along the way, sorry, you can download
the patch file from here:
http://www.cs.berkeley.edu/~rean/olio-20090729.patch
Yeah it did strip it off, I was able to get it from your link.
Also, we too, had to make changes to the driver. we had to implement
Tag.postLoad and call it from the loader. Here's our implementation
Ok, I guess I was being too clever for my own code, yours looks more
portable.
I'll raise a Jira ticket and will attach the patch to it. If you get any
more fixes, just raise a Jira ticket and attach the patch to it. Mention
Rails in the synopsis and then I'm sure to see it.
Cheers
Amanda
/* For tags, we won't know the taggings_count until all the
taggings are loaded. */
public void postLoad() {
ThreadConnection c = ThreadConnection.getInstance();
try {
c.prepareStatement("UPDATE tags SET taggings_count = " +
"(SELECT COUNT(*) FROM taggings WHERE
taggings.tag_id = tags.id)");
c.executeUpdate();
} catch (SQLException e) {
logger.log(Level.SEVERE, e.getMessage(), e);
}
thanks,
Rean
Amanda waite wrote:
Hi Rean,
Did you send the patch to Akara directly? It wasn't attached to the
email you sent to olio-dev.
I implemented a counter_cache on the Tag model before I putback the
caching code. So far the only reason that I've not done anything with
it is that I had to change the loader code in the driver to increment
the tag count for every tag it added as part of the DB loading
process and for that I used a trigger. It worked well but didn't seem
very portable, so as the caching code went some way to reducing the
issue caused by the query that the counter_cache fixed I decided to
shelf it. I still have the code and will try it with your
counter_cache code. We then need to decide whether to use it or not.
Akara, I can putback these changes.
Amanda
Rean Griffith wrote:
Hello Akara,
Attached is a patch addressing some of the issues we have run into
and "fixed" in our deployments of Olio.
Patch details:
1) *lib/tagcount.rb* has a query that has been optimized for the
home page.
2) *vendor/plugins/acts_as_taggable/lib/tagging.rb* has been changed
to support a counter_cache.
3) *db/migrate/20090713225055_add_counter_cache_to_tags.rb* has been
added to create the counter_cache.
Here are some other issues we've come across that are not resolved
in the attached patch:
1. *db/schema.rb* is missing from the repository.
2. *users.timezone* has a column size of 25, which is too small for
"International Date Line West" (28 characters long).
3. Improper checks for the presence of form fields.
- Currently, Olio uses checks against the empty string (i.e.
*params[:key] == ""*).
- This relies on quirks of the gem *rack-0.9.1*, which has been
fixed
in the newest version of rack.
- The checks should be changed to check for either empty *or* nil
(i.e. *params[:key].empty? || params[:key].nil?*).
- One example can be found in *UsersController#new_image?*.
thanks,
Rean
-------- Original Message --------
Subject: Re: [Fwd: Re: Process for Submitting Olio Revisions]
Date: Wed, 29 Jul 2009 14:35:20 -0700
From: Timothy Yung <[email protected]>
To: Rean Griffith <[email protected]>
CC: Aaron Beitch <[email protected]>
References: <[email protected]>
Attached the patch.
Regards,
Timothy Yung
On Wed, Jul 29, 2009 at 1:05 PM, Rean Griffith
<[email protected]>wrote:
-------- Original Message --------
Subject: Re: Process for Submitting Olio Revisions
Date: Tue, 28 Jul 2009 17:57:10 -0700
From: Akara Sucharitakul <[email protected]>
To: Rean Griffith <[email protected]>
CC: Armando Fox <[email protected]>
References: <[email protected]>
Please just submit the patches to [email protected]. We'll
respond and get the fixes committed. Thanks.
-Akara
Rean Griffith wrote:
Hello Akara,
Below are some issues we have come across using the latest version
of Olio
including some fixes we have come up with with, what is the
process for
reviewing and submitting patches to Olio?
thanks,
Rean
-------- Original Message --------
Subject: Olio Revisions
Date: Tue, 28 Jul 2009 17:19:16 -0700
From: Timothy Yung <[email protected]>
To: Rean Griffith <[email protected]>
CC: Aaron Beitch <[email protected]>
I have attached the files that were changed. Here are the issues
that the
files address:
- *lib/tagcount.rb* has a query that has been optimized for the
home
page.
- *vendor/plugins/acts_as_taggable/lib/tagging.rb* has been
changed to
support a counter_cache.
- *db/migrate/20090713225055_add_counter_cache_to_tags.rb* has been
added
to create the counter_cache.
Here are issues that need to be fixed but have not been included
in the
attached files.
1. *db/schema.rb* is missing from the repository.
2. *users.timezone* has a column size of 25, which is too small for
"International Date Line West" (28 characters long).
3. Improper checks for the presence of form fields.
- Currently, Olio uses checks against the empty string (i.e.
*params[:key]
== ""*).
- This relies on quirks of the gem *rack-0.9.1*, which has
been fixed
in the newest version of rack.
- The checks should be changed to check for either empty *or*
nil
(i.e. *params[:key].empty? || params[:key].nil?*).
- One example can be found in *UsersController#new_image?*.
Regards,
Timothy Yung