similar to: acts_as_state_machine override :initial state

Displaying 20 results from an estimated 1000 matches similar to: "acts_as_state_machine override :initial state"

2006 Jul 13
2
having a problem with acts_as_state_machine
Hi all: Below is s a dump from script/console in development env. Am I not supposed to be able to find the record later and use the state machine functionality, or have I missed something? Thanks Forrest ---------------------------- >> ts2 = TalkSession.create( :person_id => 2, :pattern_id => 2) => #<TalkSession:0x35811f0 @attributes={"pattern_id"=>2,
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 to catch invalid state transition (such as attempting to fulfill a
2008 Feb 28
2
random exception driving me crazy: SecurityError (Insecure: can't modify array)
Hi all, I''m running into a very strange but incredibly annoying problem that I just can''t seem to solve. The exception is occurring from a seemingly innocuous line in my code, a simple ''logger.warn("some debug information")''. The backtrace follows: SecurityError (Insecure: can''t modify array)
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.
2009 Feb 02
2
ActiveRecord::AssociationTypeMismatch (User(#54754560) expected, got User(#54510280))
i keep getting this AssociationTypeMismatch error. i think this could be a bug related to ruby/rails when using mixins. heres a short version of my code: # user.rb require ''friend_invitation'' require ''friendship'' class User < ActiveRecord::Base include FriendInvitationUser, FriendshipUser ... end # friendship.rb ... module FriendshipUser def
2006 Mar 31
6
Adding objects to a :through association
So I''m one of those nasty people building a self-referential habtm-like Association using the funky new :through stuff. This is about users having friends, so here''s my user.rb: class User < ActiveRecord::Base has_many :friendships, :foreign_key => ''user_id'' has_many :friends, :through => :friendships, :source => :friend end And here''s
2007 Dec 31
1
Store limited list in db?
Hello, I''m currently 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!
2007 May 10
5
Pagination has many through problems
I have searched for days for an example that demonstrates what i would like to do, and this morning i thought i''d worked it out, but no....here''s what i have: Controller ========== class ProfilesController < ApplicationController def friends current_user.profile.friends end def list_friends @profile_pages, @profiles = paginate( friends, :per_page => 10) end end
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
2006 May 28
7
Self-referential has_many :through relationship
Hi, I have a self-referential has_many :through relationship setup to track relationships between users. Basically relationships are modeled as a join table with an extra column ''relation''. create table relationships ( user_id integer unsigned not null, friend_id integer unsigned not null, relation char(1) not null, ) --- relations --- f = friend r = request to
2008 Jan 11
5
Missing methods
We have a custom implementation of the Mother Object idea. It''s inside of a module, basically like this: module Factory %w(account friendship person invitation message asset email_address birth).each do |klass| eval <<-EOF def self.create_#{klass}(attributes = {}) default_attributes = valid_#{klass}_attributes #{klass.camelize}.create!
2008 Mar 20
1
How to get device name with device id?
Hi all, I want to open a device(/dev/sda1, /dev/hda2 etc) in which my file exists. I've used 'stat' system call to get the device id. But now I want the device name from this id(st_dev). How to get that one? Or Do you have any other method to know the device name where my file resides? Thanks Bollywood, fun, friendship, sports and more. You name it, we have it on
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: def encoded? <check state of other objects> return true
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
2008 Mar 18
1
Polling is REALLY slow
I''m having some trouble with using brb for polling for work. Basically, what I want to do is update the state of a record and have brb notice and start a process. I do not want to call ask_work for each process because there may be several places where the object''s state is changed, and I only want to process once. Plus, I can schedule things better this way. My first thought
2003 May 09
1
correspondence analysis
Hi everybody, I am starting my friendship with R. Now I want to do a Correspondence Analysis using the vegan library or multiv library. Both give me the same results which differ from the ones I get running other programs like Statistica... I wounder if there is a problem with my matrix. I have cualitataive variable in the columns and sampling units in the rows... I import my matrix into R
2016 Feb 15
1
GTX 960M
I'm considering a Dell XPS 15 laptop, that comes with the subject GPU. Is this thing usable with nouveau? -- ======================================================================== Ian Pilcher arequipeno at gmail.com -------- "I grew up before Mark Zuckerberg invented friendship" --------
2017 Mar 13
2
MIPS emulation broken - No PCI buses available
I am trying to create a QEMU MIPS guest, so that I can test some code for big-endian safety. Every attempt to create a MIPS guest is giving me an error: Unable to complete install: 'XML error: No PCI buses available' It seems like this is a known issue. https://www.redhat.com/archives/libvir-list/2016-May/msg00197.html However, I am still getting this on a fully updated Fedora
2018 May 31
2
Make discard='unmap' the default?
Is it possible to make discard='unmap' the default for virtio-scsi disks? (Related, is it possible to make virtio-scsi the default disk type, rather than virtio-blk?) Thanks! -- ======================================================================== Ian Pilcher arequipeno@gmail.com -------- "I grew up before Mark Zuckerberg invented
2019 Sep 15
1
How to disable i915 module
I am setting up CentOS 7 on my new firewall. This will run as a head- less system, accessed via a serial console when necessary. It's only a 2GB system, so I don't see any reason to have the GPU consuming any of the RAM. I've blacklisted the i915, drm, and drm_kms_helper modules and rebuilt the initramfs, but the i915 module is still being loaded. Anyone know what might be loading