# Seed fu and restful\_authentication

**URL:** <https://www.ruby-forum.com/t/seed-fu-and-restful-authentication/171896>\
**Category:** Rails\
**Created:** [July 10, 2009, 11:30pm UTC](https://www.ruby-forum.com/t/seed-fu-and-restful-authentication/171896 "2009-07-10T23:30:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rantamplan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e8c25b/32.png) [@rantamplan](https://www.ruby-forum.com/u/rantamplan)\
**Post date:** [July 10, 2009, 11:30pm UTC](https://www.ruby-forum.com/t/seed-fu-and-restful-authentication/171896/1 "2009-07-10T23:30:39Z")

</div>

Hi,

I am trying to use both plugins in my application but I couldn’t get it  
to work.

I have included the following in my users.rb(fixtures directory):  
user = User.seed(:login) do |s|  
s.login = “admin”  
s.email = “removed\_email\_address@domain.invalid”  
s.password = “admin”  
s.password\_confirmation = “admin”  
end

The user is inserted in DB but I cannot log into the application.

Any help would be really appreciated.

Thanks

---

<div class="post-metadata">

**Author:** ![rantamplan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e8c25b/32.png) [@rantamplan](https://www.ruby-forum.com/u/rantamplan)\
**Post date:** [July 16, 2009, 6:21pm UTC](https://www.ruby-forum.com/t/seed-fu-and-restful-authentication/171896/2 "2009-07-16T18:21:10Z")

</div>

Hi all,

Sorry for reviving a 6 day old e-mail, but I have a similar question  
that I can’t seem to figure out.

I’m running restful\_authentication with -aasm and I’m looking to seed  
my user data such that an e-mail will be sent to the user after  
creation to activate the account.

Has anyone done something similar?

On Jul 11, 5:30 am, Marcos C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![rantamplan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e8c25b/32.png) [@rantamplan](https://www.ruby-forum.com/u/rantamplan)\
**Post date:** [July 16, 2009, 6:52pm UTC](https://www.ruby-forum.com/t/seed-fu-and-restful-authentication/171896/3 "2009-07-16T18:52:07Z")

</div>

Hi David,

On Thu, 2009-07-16 at 09:20 -0700, David C. wrote:

> Hi all,
> 
> Sorry for reviving a 6 day old e-mail, but I have a similar question  
> that I can’t seem to figure out.
> 
> I’m running restful\_authentication with -aasm and I’m looking to seed  
> my user data such that an e-mail will be sent to the user after  
> creation to activate the account.
> 
> Has anyone done something similar?

Check out Bala P.'s simply-rich-authenticator mini app.

[http://code.google.com/p/simply-rich-authenticator](http://code.google.com/p/simply-rich-authenticator)

HTH,  
Bill

---

<div class="post-metadata">

**Author:** ![rantamplan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e8c25b/32.png) [@rantamplan](https://www.ruby-forum.com/u/rantamplan)\
**Post date:** [July 17, 2009, 2:13am UTC](https://www.ruby-forum.com/t/seed-fu-and-restful-authentication/171896/4 "2009-07-17T02:13:17Z")

</div>

Hi Bill,

Thanks for the link.

I’ve looked through the source code but I couldn’t find what I’m looking  
for. The app doesn’t seem to be seeding data?

Warmest regards,  
David

---

<div class="post-metadata">

**Author:** ![rantamplan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e8c25b/32.png) [@rantamplan](https://www.ruby-forum.com/u/rantamplan)\
**Post date:** [July 17, 2009, 6:13am UTC](https://www.ruby-forum.com/t/seed-fu-and-restful-authentication/171896/5 "2009-07-17T06:13:24Z")

</div>

Hi David,

On Fri, 2009-07-17 at 08:12 +0800, David C. wrote:

> Hi Bill,
> 
> Thanks for the link.

You’re welcome.

> I’ve looked through the source code but I couldn’t find what I’m  
> looking for. The app doesn’t seem to be seeding data?

Depends on what you mean by ‘seeding’ I guess. It’s not using seed\_fu.  
But, if I understand (not having used it) what seed-fu does, it does  
what Bala’s User.create method does, just in a batch-type mode. Bala’s  
UserObserver class takes care of the getting the aasm started and  
kicking off the mailer functionality I thought you’re looking for.  
Seemed to me like an straight-forward marriage. But maybe I  
misunderstood. If so, sorry for the noise.

Best regards,  
Bill

---

<div class="post-metadata">

**Author:** ![rantamplan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e8c25b/32.png) [@rantamplan](https://www.ruby-forum.com/u/rantamplan)\
**Post date:** [July 19, 2009, 6:08am UTC](https://www.ruby-forum.com/t/seed-fu-and-restful-authentication/171896/6 "2009-07-19T06:08:17Z")

</div>

Hi Bill,

What if I’m trying to basically skip the activation part (ie. make them  
automatically activated) for seeded users?

David

---

<div class="post-metadata">

**Author:** ![rantamplan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e8c25b/32.png) [@rantamplan](https://www.ruby-forum.com/u/rantamplan)\
**Post date:** [July 19, 2009, 5:31pm UTC](https://www.ruby-forum.com/t/seed-fu-and-restful-authentication/171896/7 "2009-07-19T17:31:46Z")

</div>

Hi David,

On Sun, 2009-07-19 at 12:07 +0800, David C. wrote:

> Hi Bill,
> 
> What if I’m trying to basically skip the activation part (ie. make  
> them automatically activated) for seeded users?

I’m not sure I understand what you’re trying to accomplish, so I’ll have  
to respond in generalities.

aasm defines a set of states and allows you to trigger methods when the  
object transitions from one state to another. It’s up to you to define  
the states, transitions, and methods.

So the question is, what does ‘activated’ mean in your case?

Sorry, but I can’t be more help without more information.

Best regards,  
Bill
