search for: acts_as_state_machin

Displaying 20 results from an estimated 22 matches for "acts_as_state_machin".

Did you mean: acts_as_state_machine
2008 Jan 07
2
acts_as_state_machine override :initial state
Hello, I''m not sure if this is where to post this, but i cannot find much information/support for acts_as_state_machine. I have a Friendship model which implements acts_as_state_machine. I have an :initial state of :pending, but i would like to create a Friendship model and save it directly with :accepted status. I have tried Friendship.create(:state => "accepted") and Friendship.new, friendship.sta...
2006 Jul 13
2
having a problem with acts_as_state_machine
...erts >> ts3.current_state NoMethodError: undefined method `state'' for #<TalkSession:0x32f5f08> from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/base.rb:1792:in `method_missing'' from ./script/../config/../config/../vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb:68:in `current_state'' from (irb):16
2008 Feb 28
2
random exception driving me crazy: SecurityError (Insecure: can't modify array)
...esupport/lib/active_support/buffered_logger.rb:68:in `add'' [RAILS_ROOT]/vendor/rails/activesupport/lib/active_support/buffered_logger.rb:75:in `warn'' [RAILS_ROOT]/app/models/order.rb:244:in `process_with_active_merchant'' [RAILS_ROOT]/vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb:162:in `call'' The line in my model class, order.rb, that causes the exception is the following: logger.warn("Processing order with payment gateway") Now, I could probably just remove the offending log line to fix the problem, but this bothers me,...
2008 Jan 23
1
acts_as_state_machine doesn't error on invalid state transition?
While using acts_as_state_machine, I noticed it doesn''t error when invalid state transition is used. No false return, no exception. By invalid state transition, I mean utilizing an event that does not define the current state as a ''from'' state. Does anyone find this lacking? I would like to be able t...
2008 Aug 25
1
acts_as_state_machine: SecurityError calling insecure method
(also posted on rails forum: http://railsforum.com/viewtopic.php?id=21744, then I discovered this lilst and there are many more people...) Hi, since yesterday I suddenly recieve lots of such messages in my logfiles - and everything in the user model that uses that plugin fails! My deployed Rails code hasn''t changeed in 5 days, and those errors started to appear only a day ago.
2008 Oct 28
7
aasm callback order?
Hello! Sometime ago I ran across a webpage where someone had identified the full callback sequence for an object lifecycle including AASM with it''s :enter and :exit and whatnot callbacks. Unfortunately, I can''t find it and searches don''t seem to help. Does anyone have a reference to a page that shows the callback sequence with Acts As State Machine (the gem)? I think
2008 Feb 11
6
Should I Test My Fixtures?
I have a number of fixtures in my test suite. For example, with acts_as_authenticated and acts_as_state_machine, I created a number of users in different account states for use in functional testing. (Suspended users can not log in, etc) Is it a good idea to run fixtures through tests to ensure that they conform to their ideals? EG: assert users(:suspended_user).suspended? If so, where should these tests...
2007 Dec 31
1
Store limited list in db?
...ently developing an application which contains a Movie object. I was wondering what the best way to store a limited list such as mpaa_rating would be? The list is not likely to expand often, so i was wondering if it was still best to store this list in a table? Or if there was something else like acts_as_state_machine for maintaining a simple list like this. thanks! Adam -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send emai...
2006 Apr 16
2
Making requests in order
Hello all, This is an interesting problem I have been working on. What I have is a little multiuser project request tracking application. What happens is that I log in and create projects and assign people to the projects. Each project has steps associated with it, and the steps need to be done in a certain order. Now, I have to request that the assigned person perform each of the steps, and
2007 Mar 27
3
Stubbing out method for all instances
I am using the acts_as_state_machine plugin to control state of an object in my app, however when testing this I need to be able to stub out the guard conditions so that state will change when I fire off an event without depending on other models. Guard conditions simply return true or false so I have an instance method: de...
2007 Jan 24
2
hello! first post + context_setup
Greetings all. I''m looking over a ''greenfield'' pasture, and enjoying the TDD(BDD) process of creation. I''m currently rspec''ing a finite state machine (acts_as_state_machine). As such, I need to persist the model through ''specifies'' within the context - from top to bottom. I have bumped into a couple of probs: 1. context_setup to define the doesn''t permit access to fixtures. "You have a nil object when you didn''t expect i...
2008 Mar 18
1
Polling is REALLY slow
...oller_worker QUEUE_SLEEP_TIME = 30 # seconds def create(args = nil) @running = true self.poll_queue end def build_all_matches(args = nil) thread_pool.defer(args) do |args| requests = Request.find_active(:all) requests.each { |request| request.queue! } # using acts_as_state_machine end end protected # Was hoping to get multiple threads processing def build_matches(args = nil) thread_pool.defer(args) do |args| request = Request.find(args.to_i) request.build_matches end end def poll_queue Thread.new do while @running do...
2008 Sep 08
2
Restful Authentication and State Machine state transfer question
I''m adding some code to a project using restful_authentication and acts_as_statemachine In the create method for a user there is the following code generated by the restful_authentication template @user.regster! if user.valid? And this will save and the user record if it is valid. I understand that the statemachine will then change the state from passive to pending. It will guard
2006 Jul 04
3
act_as_state_machine plugin inaccessible
Seems like act_as_state_machine plugin is not accessible from http://lunchroom.lunchboxsoftware.com/articles/2006/01/21/acts-as-state-machine as this site is down and script/plugin discover is broken as it fails when trying to add plugin repositories giving the message as below; Add http://svn.northpub.com/plugins/? [Y/n] y (eval):3:in `each'': undefined method `[]'' for
2007 Jul 07
4
Setting a callback whose action depends on the previous state of the object
I''ve been reading about ActiveRecord::Callbacks and they''re really cool. But I have a complex need I''m not sure they answer. Let''s say we have a User model. User has a #status attribute, which can be either "active", "closed" or "blocked". I want to set a callback to perform an action if an "active" User has been
2006 Apr 28
3
Rails wizard page support
Hello, does anyone know if there is a "best practice" how to implement wizard pages in RoR? I want to have multiple pages for entity editing and creation. Is there any rails plugin available? I think it would be nice to have a howto in the rails wiki or to have built-in wizard support in RoR. What do you think? Any suggestions how to implement this elegant? -- Oliver Paulus OpenPGP
2008 Jan 22
2
Threadpool and queuing of tasks
I recently switched over to v1.0, and things are rolling along pretty well. However, one thing that has always been a little confusing to me is knowing when to use thread_pool. Since most of my bgrb workers are called from my web app to process rather than being scheduled, I''m using the thread_pool for every call. Unfortunately, that means that I have to split up workers by how many
2008 May 04
12
best approach to managing workers and getting status
Hi, I am using backgroundrb to process audio files from a rails controller. Currently a new worker gets created every time the method is called on the worker, using this code: @job_key = MiddleMan.new_worker(:worker => :audio_file_worker, :job_key => Time.now.to_i) MiddleMan.worker(:audio_file_worker, @job_key).make_new_audio_file(params[:release_id]) I need to create the new
2006 Jul 21
4
Using a controller to initiate a plugin?
Folks I am new so I apologize if I come off as a totaly tool. I am finding Rails to be an amazing framework to use and having fun with it. I have run into a frustrating snag however with PLUGINS. I have a plugin installed in: /myapp/vendor/plugins/ When I run: ruby script/server in /myapp/ my WEBrick starts normally and I can access IP:3000. I get the default rails index page. How do I
2006 Mar 03
7
Workflow + Rails
Is there any project or solution for an easy integration of a WFE / WfMS into rails? I''m quite new to this topic, but I probably need a small subset of workflow patterns (or whatever the correct term is) only. Any pointers are welcome. -- Posted via http://www.ruby-forum.com/.