similar to: Force an object to previous state, when using lock_version

Displaying 20 results from an estimated 10000 matches similar to: "Force an object to previous state, when using lock_version"

2008 Oct 21
1
How to force a lock_version increment
Hi everyone, I have a order with order_lines use case. On changing the lines, I want to be sure no one else changed the order. So I use lock_version on the order. This works fine if something is changed on the order record. But now i have the situation that I delete, alter and add order lines without changing the order record itself. I have to check and increment the order#lock_version however
2006 May 17
0
acts_as_versioned with lock_version bug?
Hello. The acts_as_versioned plugin works fine ... till the adjunction of optimistic locking via the lock_version table column. Here is the problem description: Without optimistic locking things are fine: # ++++ The table creation migration ++++ % cat db/migrate/001_create_tables.rb class CreateTables < ActiveRecord::Migration def self.up create_table :softwares,
2006 Jul 06
4
update_all Not Incrementing lock_version
Shouldn''t update_all be updating lock_version? As you can see from my console session below, it is upating the record (changed running attribute to true and returned 1 to show 1 recored was updated). But it did not increment lock_version. And optimistic locking is working correctly otherwise. As you can see below, lock version = 562 before and after the update_all call but it is
2006 Jan 04
2
Rename lock_version field?
Hi, Is there a way to tell Rails that the magic field name for optimistic database locking is not lock_version? I have a legacy database where the optimistic locking field is named "version". Thanks, Phil -- Posted via http://www.ruby-forum.com/.
2013 Dec 20
0
How to force dispatch to an internal generic?
Dear R-devel, I have a class 'myClass' in R that is essentially a list with pre-specified structure. It has an assignment operator which is going to do some things and then should assign the value using the regular list assignment operator `$<-.myClass`<-function(x,i,value){ # do some pre-processing stuff # make the assignment using the default list assignment
2010 Sep 22
0
ActiveRecord#touch behaviour in Rails 3
In Rails 2.x, calling touch on an ActiveRecord model would update the ''lock_version'' on the model, if it were present. It would produce something like this in SQL: UPDATE `foo` SET `updated_at` = ''2010-07-23 10:44:19'', `lock_version'' = 2 WHERE ''lock_version'' = 1 This would ensure that your optimistic locking policy will be followed
2006 Jan 06
0
[PATCH] [3402] Allow lock_version column name to be configured.
My first stab at the whole metaprogramming / DSL thing. Fun stuff. Includes unit tests, fixtures, etc, etc. Tested against Oracle and PostgreSQL so far. I''d appreciate it if some MySQL folks could try it out. Hopefully I got the MySQL CREATE TABLE syntax correct. http://dev.rubyonrails.org/ticket/3402 Assuming this kind of thing is OK, I''d like to make
2007 Mar 25
1
Optimistic locking and update_attributes: not working?
Hi all, I''ve searched the forumns, but I can''t seem to find an answer to this one. I''m having trouble getting optimistic locking (OL) to work in my app, even though all of the pieces are there: * table has lock_version column, with default of 0 (zero) * lock_version column is being incremented by the first update (but the second doesn''t catch it) *
2007 Dec 01
3
Rails 2 problem with compute_public_path
I''m trying to migrate to Rails 2, but keep getting these errors all over the place: ActionView::TemplateError: wrong number of arguments (2 for 3) On line #61 of users/new.rhtml 58: <% if @captcha_error -%><div class="fieldWithErrors">< % end -%> 59: <table class="signup"><tr> 60: <td
2012 Nov 12
3
Updating objects in arrays
Perhaps this is a Rails issue. However, I need to first determine whether I simply am missing something about updating members of an array. I have an array of 10 ActiveRecord objects. I wish to iterate over the array and update an attribute. When I do this the underlying table row changes but the object in the array frequently does not. For example: count = 0 current_entries.each do
2012 Sep 18
0
Appending many different and separate Excel files using R
Hello, This is the sort of question that could interess others, so you should have CCed it to the list. As for the question, from the package vignette, section 3.3.6: "writeWorksheetToFile() is a wrapper function, calling loadWorkbook(), createSheet() and saveWorkbook() functions subsequently. It therefore allows for writing data into worksheets of an Excel file in one call." To
2012 Jul 19
0
[LLVMdev] Supporting Classes using OCaml.
Hello all... I'm trying to create a simple language that supports classes using the OCaml API. When I use the web page demo to produce the intermediate code for the following C++ example ... class MyClass { public: MyClass(); int c; }; MyClass::MyClass () { c=55; } ...I get something like this .... %class.MyClass = type { i32 } @MyClass::MyClass() = alias void (%class.MyClass*)*
2005 Dec 07
1
Dots argument in apply method
Hello everyone, I'm working on a package using S4 classes and methods and I ran into the following "problem" when I tried to create an "apply" method for objects of one of my new classes. I've found a way around the problem but I wonder if I did not paint myself into the corner. I'd like your opinion about that. So I have an object "myObj" of class
2011 Oct 31
1
Question about copying reference objects using the initialize method
Dears, I have a question about copying reference objects using the initialize method. 1) If the latter has no arguments, there is no problem to copy an object. myClass = setRefClass("myClass", fields = list(value = "numeric") ) myClass$methods(initialize = function(...){ ? value <<- 1 ? callSuper(...) }) newObject = myClass$new() newObject$value = 2 copyObject =
2007 Mar 30
2
Replacing slot of S4 class in method of S4 class?
Dear all, Assume that I have an S4 class "MyClass" with a slot "myname", which is initialized to: myname="" in method("initialize"): myclass <- new("MyClass", myname="") Assume that class "MyClass" has a method "mymethod": "mymethod.MyClass" <- function(object, myname=character(0), ...) {
2008 Dec 22
1
How to add a slot to S4 class of an existing package?
Dear all, Since my package is based on S4 classes, I would like to know how to add a slot to an existing S4 class without breaking the code of users of my package. Assume the following S4 class: setClass("MyClass", representation(name = "character", type = "character", data = "data.frame" ), prototype(name =
2009 Aug 10
1
[PATCH server] Fixed db-omatic so it doesn't die due to an unhandled ActiveRecord::StaleObjectError exception.
The error is caused by the save! method updating an object that another thread (most likely in taskomatic) already updated. In the case of this race condition, we retry saving. However, a proper fix would involve fixing the locking. --- src/db-omatic/db_omatic.rb | 23 ++++++++++++++++++++--- 1 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/db-omatic/db_omatic.rb
2007 Oct 03
2
Scroll to anchor from RJS
Is there an way to tell the browser to scroll to a certain anchor from an RJS template? I''m doing a page update, adding stuff at the bottom and want to browser to go there after it''s been added. Thanks, Helzer --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
2008 May 13
0
'cat' and 'write' as generic, just like 'c', 'cbind' etc?
Dear list: is there any good reason why 'c', 'cbind', 'rbind' etc (all defined as 'function(..., <rest>)') are generic and thus methods can be defined whereas such quite useful functions like 'cat' and 'write' are not? Would it not be reasonable to add such functionality? This would allow to define S3/S4 methods for cat and write for complex
2019 Jul 15
0
[External] Re: Possible bug in `class<-` when a class-specific '[[.' method is defined
Pasting the entire example into RStudio and hitting return to evaluate does not show this. Evaluating the finall line to print counttt separately does. Looks like RStudio is calling `[[` on your object when examining the environment for the Environment panel. If this concerns you then you should contact RStudio. Best, luke On Mon, 15 Jul 2019, Rui Barradas wrote: > Hello, > > Clean R