WTTechLabs / taskboard

your on-line tool for task management fun
http://taskboard.cognifide.com
GNU General Public License v3.0
60 stars 16 forks source link

[patch] uninitialized constant User::Digest #63

Open szpak opened 14 years ago

szpak commented 14 years ago

Error during 'rake db:migrate': == AddDefaultUsers: migrating ================================================ rake aborted! An error has occurred, this and all later migrations canceled:

uninitialized constant User::Digest

(See full trace by running task with --trace)

Trace shown: uninitialized constant User::Digest /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:105:in const_missing' /home/szpak/cosie/code/taskboard/taskboard/app/models/user.rb:56:inencrypted_password' /home/szpak/cosie/code/taskboard/taskboard/app/models/user.rb:32:in `password='

Attached patch fixed a problem. Ruby 1.8.6, RubyGems 1.3.1 with Postgresql on Fedora 11.

Making a branch would be probably a better idea, but a change is really small. Patch agaist current git.

diff --git a/app/models/user.rb b/app/models/user.rb
index ce6ebd6..1756351 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -15,6 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with Taskboard. If not, see <http://www.gnu.org/licenses/>.

+require 'digest/md5'
+
 class User < ActiveRecord::Base
   validates_presence_of :username
   validates_uniqueness_of :username
bartaz commented 14 years ago

Thanks for feedback (and patch that fixes the bug!) :)

We will investigate it but requiring Digest module shouldn't break it for other databases/systems, so no branch will be needed.

We simply assumed that it's always available as part of standard Ruby libraries.

szpak commented 14 years ago

Today I was installing latest Taskboard on CentOS and there was a problem wit User::SHA1 instead of User:Digest.

szpak commented 14 years ago

Btw, when I was talking about branch I didn't suggest that there should be some branch or fork to handle that, but seeing a lack of ability to attach a patch as a file to submitted issue (what is a standard for issue trackers) I thought it's because the site is git related and promote making a branch to fix an issue and put back an URL to that branch in the issue to merge it into main branch by a project developer.

bartaz commented 14 years ago

On a GitHub they prefer the 'fork' style of contibuting.

You can fork Taskboard project (by clicking on 'fork' button somewhere on the top of the page) and it will create a copy of it as your repository. You can then apply any fixes for yourself and push them to your Taskboard repository. If we like some of commits to your repository we can quite easily apply them to our code (just like a patch).

szpak commented 14 years ago

I've tried with #66, but had a few problems. Git is quite different than Bazaar. Please check if there is everything ok with pull request.

jug commented 14 years ago

we had the same problem (as far as i remember it was on a debian-system), but i fixed it by importing the following instead:

--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -15,6 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with Taskboard. If not, see .

+require 'digest/sha1'
+
 class User < ActiveRecord::Base
   validates_presence_of :username
   validates_uniqueness_of :username

I think the ruby docs say somewhere, that it should work without the "require". But obviously it didn't (on some systems).