Forum: Ruby on Rails file_column and login_engine incompatibilities

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Richard L. (Guest)
on 2006-02-20 16:41
(Received via mailing list)
Hi, has anyone come across any incompatibilities between file_column and
login_engine?

I've been having strange issues where a User model with file_column in
it is failing to save the images properly. Everything uploads to the tmp
dir fine, but then it never gets copied to the proper permanent
location.

No errors - everything happens fine except for that final part.

I have file_column up and running fine on other models, it's just the
User model which it doesn't work on.

If I don't mixin LoginEngine::AuthenticatedUser to my model, all works
fine again! So there's definitely something up there.

I'm off to a meeting now so can't look any further, but will spend the
evening ripping it apart to see what's wrong unless anyone else has come
across this before, or can point me in the right direction!

Thanks in advance to any advice or pointers.
Nic W. (Guest)
on 2006-02-20 19:33
(Received via mailing list)
I have the same problem, but w/a more vanilla model, and it depends on
the image! Look for my post about 0kb files

I'm running this on W2K3 Enterprise, and testing w/Webrick. Apache
makes no difference in the problem.

On 2/20/06, Richard L. <removed_email_address@domain.invalid> wrote:
> User model which it doesn't work on.
> --
> R.Livsey
> http://livsey.org
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>


--
- Nic
Richard L. (Guest)
on 2006-02-20 23:39
(Received via mailing list)
> On 2/20/06, Richard L. <removed_email_address@domain.invalid> wrote:
>> Hi, has anyone come across any incompatibilities between file_column and
>> login_engine?
>> I have file_column up and running fine on other models, it's just the
>> User model which it doesn't work on.
>>
>> If I don't mixin LoginEngine::AuthenticatedUser to my model, all works
>> fine again! So there's definitely something up there.

Nic W. wrote:
 > I have the same problem, but w/a more vanilla model, and it depends
on
 > the image! Look for my post about 0kb files
 >
 > I'm running this on W2K3 Enterprise, and testing w/Webrick. Apache
 > makes no difference in the problem.

Solved it!

After some liberal commenting out of code in
LoginEngine::AuthenticatedUser I narrowed it down to this line:

after_save '@new_password = false'

Commenting out this line and suddenly everything works.
That line evaluates to false, which I guess stops the callback queue
maybe?

Anyway, making that evaluate to true and everything works again.
There are a number of ways you could do this, I changed that line to:

after_save :falsify_new_password

and then added the falsify_new_password method under crypt_password
(around line 130)

def falsify_new_password
   @new_password = false
   true
end

--
R.Livsey
http://livsey.org
James A. (Guest)
on 2006-02-20 23:58
(Received via mailing list)
I've submitted this as a ticket on the engines Trac site. Thanks for
tracing this bug!

- james

On 2/20/06, Richard L. <removed_email_address@domain.invalid> wrote:
>  > I have the same problem, but w/a more vanilla model, and it depends on
> after_save '@new_password = false'
> (around line 130)
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>


--
* J *
  ~
This topic is locked and can not be replied to.