Awesome...I had tried Hobo::Guest yesterday as well, really appreciate the help!
-Chris On Wed, Jun 9, 2010 at 11:32 AM, Bryan Larsen <[email protected]>wrote: > What's ":available_to" set to on your signup? The default is > "Guest", and an administrator is not a guest. :) > > You can try: > > User::Lifecycle.signup(Guest.new, :name => > "automated", :email_address => "[email protected]") > > or you can add another creator to your transition with a > different :available_to. > > Bryan > > On Jun 9, 9:19 am, Chris Apolzon <[email protected]> wrote: > > Hmm. Thats basically what I was doing (I used User.first, but since the > > User model automatically assigns the first user as an admin I think it > would > > have been the same). > > When I execute your example, I get the same PermissionDeniedError: > > > > ree-1.8.7-2010.01 > User::Lifecycle.signup(admin, :name => "automated", > > :email_address => "[email protected]") > > Hobo::PermissionDeniedError: Hobo::PermissionDeniedError > > from > > > /Users/chris/.rvm/gems/ree-1.8.7-2010.01/gems/hobo-1.0.1/lib/hobo/lifecycles/creator.rb:59:in > > `run!' > > from > > > /Users/chris/.rvm/gems/ree-1.8.7-2010.01/gems/hobo-1.0.1/lib/hobo/permissions.rb:171:in > > `with_acting_user' > > from > > > /Users/chris/.rvm/gems/ree-1.8.7-2010.01/gems/hobo-1.0.1/lib/hobo/lifecycles/creator.rb:51:in > > `run!' > > from > > > /Users/chris/.rvm/gems/ree-1.8.7-2010.01/gems/hobo-1.0.1/lib/hobo/lifecycles/lifecycle.rb:97:in > > `create' > > from (eval):3:in `signup' > > from (irb):3 > > > > Thanks. > > > > On Tue, Jun 8, 2010 at 8:46 PM, Bryan Larsen <[email protected]> > wrote: > > > Hmmm, it seems that transitions have this documented, but creators > don't. > > > > > To get an admin, you can use Hobo's automatic scopes: > > > > > admin = User.administrator.first > > > > > To call a creator from code, use something like: > > > > > User::Lifecycle.signup(admin, :name => "blah", :email_address => " > > > [email protected]", ...) > > > > > Bryan > > > > > On 10-06-08 07:53 PM, Chris Apolzon wrote: > > > > >> I'm trying to create some default users and push another model's > > >> lifecycle to various states to create some dummy content at various > > >> states in my app. So far, I've been unsuccessful (only on the user > > >> part right now). I looked through the source code for the creator > > >> page actions, but I'm not really sure how to masquerade as the > > >> administrator so that the acting_user variables are setup in the > > >> methods I'm calling. (Or really what I'm doing in general...) > > > > >> I thought I had seen some posts on testing lifecycles but I haven't > > >> found anything helpful yet. > > > > >> Any advice or pointers to the posts that eluded me would be greatly > > >> appreciated. > > > > >> Thanks! > > >> -Chris > > > > > -- > > > You received this message because you are subscribed to the Google > Groups > > > "Hobo Users" group. > > > To post to this group, send email to [email protected]. > > > To unsubscribe from this group, send email to > > > [email protected]<hobousers%[email protected]> > <hobousers%[email protected]<hobousers%[email protected]> > > > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/hobousers?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Hobo Users" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<hobousers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/hobousers?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Hobo Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/hobousers?hl=en.
