Hi fellows!
Is there a way to atomically exchange values of records which are validated
using 'validates_uniqueness_of'?
Some details follow.
Imagine I have a model:
class Item ActiveRecord::Base
validates_uniqueness_of :weight
end
'weight' is a sorting weight.
I have an index.html view
On Thu, Jan 5, 2012 at 2:35 PM, Dmitry Suzdalev dim...@gmail.com wrote:
Hi fellows!
Is there a way to atomically exchange values of records which are
validated using 'validates_uniqueness_of'?
Some details follow.
Imagine I have a model:
class Item ActiveRecord::Base
On 5 January 2012 18:09, Peter Vandenabeele pe...@vandenabeele.com wrote:
If you mean atomic on the level of saving to the database
(all or nothing), you would need a database transaction.
http://api.rubyonrails.org/classes/ActiveRecord/Transactions/ClassMethods.html
Second, to circumvent
3 matches
Mail list logo