Login troubles

34 views
Skip to first unread message

Denis Peplin

unread,
Jan 22, 2012, 12:39:13 AM1/22/12
to ror_ecommerce
After login, ror-e writes on the top "Hi (not you?), but still
redirects me from front page to login page.

And localhost:3000/admin/overviews page (BTW, it not mentioned on
frontpage of ror-e.com site) redirects me to /login page too.

This is output from "rake spec" on my installation:

Finished in 102.84 seconds
1039 examples, 0 failures, 13 pending

Denis Peplin

unread,
Jan 22, 2012, 1:09:42 AM1/22/12
to ror_ecommerce
After linking registered user to super_administrator role:

$ rails c
> UserRole.create(user_id: 1, role_id: 1)

I got access to admin interface.

Is this a standard way?

David Henner

unread,
Jan 22, 2012, 1:30:16 AM1/22/12
to ror_ec...@googlegroups.com
When did you checkout the repo?  I've been making some changes in the last day or two so I'd like to replicate with the version you have.

As for login...   Looks like this might be an issue.  I had a test to ensure this doesn't happen.  I'll start the repo from scratch to see what happens.  Once I can peplicate i'll post an update.

dave

David Henner

unread,
Jan 22, 2012, 1:31:04 AM1/22/12
to ror_ec...@googlegroups.com
BTW   UserRole.create(user_id: 1, role_id: 1)  will solve the problem but is not the standard way.

David Henner

unread,
Jan 22, 2012, 1:46:39 AM1/22/12
to ror_ec...@googlegroups.com
Hmmm  I just started the app from scratch and everything worked. 

Can you give me your ruby version?  Also are you using the rails 3.2 version of the repo?  I'd love to recreate the issue so any details would be awesome. 

Also please confirm all is working after setting your roles.  I wouldn't want you to be frustrated.  =)

Dave

Denis Peplin

unread,
Jan 22, 2012, 2:44:14 AM1/22/12
to ror_ec...@googlegroups.com, David Henner
2012/1/22 David Henner <drhe...@gmail.com>:

> Hmmm  I just started the app from scratch and everything worked.
>
> Can you give me your ruby version?  Also are you using the rails 3.2 version
> of the repo?  I'd love to recreate the issue so any details would be
> awesome.

$ ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]

$ rails -v
Rails 3.1.3

All this on Kubuntu. But I'm using sqlite3 for development, can it be an issue?

I'm also attached Gemfile.lock.

>
> Also please confirm all is working after setting your roles.  I wouldn't
> want you to be frustrated.  =)

Actually, I'm a bit frustrated. Product addition require many steps,
which purposes
I'm don't completely understand, and, as result, I can only enter into
products?product_type_id=1,
and don't see any products inside.

And what about UserRole model? It it really needed? In other words, it
there any need to work with
relation directly? If not, has_and_belongs_to_many can be used
instead, with separate join table,
but without UserRole model.

http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html
"Choosing which way to build a many-to-many relationship is not always
simple. If you need to work
with the relationship model as its own entity, use has_many :through.
Use has_and_belongs_to_many
when working with legacy schemas or when you never work directly with
the relationship itself."

Gemfile.lock

Denis Peplin

unread,
Jan 22, 2012, 2:51:25 AM1/22/12
to ror_ec...@googlegroups.com, David Henner
About repo checkout: it was yesterday, and now with 'git checkout' I
see that nothing changed.
Reply all
Reply to author
Forward
0 new messages