Displaying 20 results from an estimated 40000 matches similar to: "Feedback Needed: Optimistic Locking Destroy Bug"
2013 Feb 25
7
Optimistic Locking Enhancements: Gem or Core?
I''m working on an app that makes use of rails'' optimistic locking feature
and seeing some possibilities for improvements. It seems a bit tedious to
have to add :lock_version to forms wherever the model is used. You also
have to "hack" around rails'' UJS feature to add it as a URL parameter when
using remote: true, method: [:put, :patch, :post, :delete].
2010 Jun 08
1
[PATCH] Fix optimistic locking during vm migration
Signed-off-by: Loiseleur Michel <mloiseleur at linagora.com>
---
src/db-omatic/db_omatic.rb | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/db-omatic/db_omatic.rb b/src/db-omatic/db_omatic.rb
index da11bfa..79f29d2 100755
--- a/src/db-omatic/db_omatic.rb
+++ b/src/db-omatic/db_omatic.rb
@@ -195,6 +195,9 @@ class DbOmatic < Qmf::ConsoleHandler
end
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)
*
2006 May 09
7
When to use optimistic locking?
Hi All,
I''m having some trouble deciding when and how to implement optimistic
locking.
Let''s say I have a multiuser Rails app, and let''s say it stores,
among other things "vital" customer information.
The standard methods created by the Rails generate scaffold script
look like this:
def edit
@customer = Customer.find(params[:id])
end
2006 Apr 11
1
Implementing Optimistic Offline Lock - How ?
I understand that ActiveRecord supports the "optimistic offline
lock"-pattern through magic fields (created_at, updated_at). However, a
scaffolded CRUD-Controller doesn''t generate the necessary code to
support this feature (the model state gets lost between two action
calls).
What is the best practice to prevent users from overwriting objects with
outdated data ?
--
2007 Nov 16
1
small patch for attr_readonly
A small patch to fix attr_readonly when used in conjunction with
optimistic locking
Please Review:
http://dev.rubyonrails.org/ticket/10188
+1 if it works for you.
nick.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To post to this group, send email to
2013 Apr 19
0
Question marks in SQL string literals
Hi all!
Recently I discovered that AR tries to treat question marks inside SQL
string literals as parameters, however this behaviour shows in very rare
cases, for example (very odd, but...):
User.where("NOT EXISTS (#{ Comment.where(''user_id = users.id AND body ILIKE
?'', ''%?'').to_sql }) AND created_at > ?", Date.yesterday).to_sql
It will fail,
2013 Mar 07
1
Should ActiveRecord::RecordNotSaved attach the record in question?
I''m doing some work where I want to rescue ActiveRecord::RecordNotSaved
from a save! call nested deep in the code. The thing is there could
theoretically be failures here I want to pass through, and I want to
inspect the record in order to decide.
I figure a custom initializer on the exception class and a couple quick
patches here and there in the code would make it minimally
2013 May 22
3
rails 4, active record: appending to has_many :through does not create join model anymore?
hi folks.
on rails 4, can somebody confirm that pushing model instances onto a
has_many :through relation does not create the necessary join model anymore?
class Reader < AR::Base
belongs_to :post
belongs_to :person
end
class Post < AR::Base
has_many :readers
has_many :people, through: :readers
end
@post.people << Person.new
so,
2013 Jul 25
0
Reported timing aren't thread-safe, are they?
I was taking a look at the implementation for reporting the time spent
on each part of an action processing.
Rails, by default will report timing for the view and db (ActiveRecord).
Both use class attributes for storing the timing (or accumulating them
in the case of AR), which are shared among all threads.
This is fine if you''re deploying using the fork approach, like done by
2013 Jun 27
2
Date.weekend?
Hello,
Having a boolean *.weekend?* on the Date class would be a good feature. It
will basically do this:
saturday? || sunday?
Makes the code cleaner and easier to read.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
2013 Apr 28
2
[ActiveSupport] Add a "remaining_to" method to date class
Just that:
class Date
> def remaining_to(date)
> if date.acts_like? :date
> date - self
> end
> end
>
alias :days_to
end
and then be able to do this:
Date.today.remaining_to(Date.parse ''2014-04-02'').days.seconds
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To
2013 Oct 11
2
Ruby and Rails Sophisticated CMS
Hi
I am looking for Ruby and Rails Sophisticated CMS refinery is looking good
to me except its is simple content model and age based. Also I looked into
locomotive the problem with locomotive is no SQL support.Could someone
refer me one please.
Thanks
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from
2013 May 23
1
ORA-30678: too many open connections
Hello Ruby
please i need your help
when i run api i get this error .
*ORA-30678: too many open connections*
**
* *
*ORA-06512: at "SYS.UTL_TCP", line 28*
* *
*ORA-06512: at "SYS.UTL_TCP", line 257*
* *
*ORA-06512: at "SYS.UTL_SMTP", line 116*
* *
*ORA-06512: at "SYS.UTL_SMTP", line 139*
* *
*ORA-06512: at "APPS.SEND_MAIL", line 12*
* *
2007 Oct 07
0
Rails AR/Oracle Unit Test: [7769] failed (getting worse)
"bitsweat" has kicked AR/Oracle while it was down...
http://dev.rubyonrails.org/changeset/7769
------------------------------------------------------------------------
r7769 | bitsweat | 2007-10-06 22:29:37 -0700 (Sat, 06 Oct 2007) | 1 line
MySQL: speedup date/time parsing.
------------------------------------------------------------------------
U
2013 Jun 25
1
Casting gem usage in Rails 4/Ruby 2 vs. Rails 4 push for concern usage/Rails delegation
Just read about the Casting gem:
https://discuss.gemnasium.com/t/casting-adding-behavior-to-objects-without-using-extend/34
https://github.com/saturnflyer/casting
What are the Rails core team''s opinions about using Casting vs.
ActiveSupport::Concern usage, Rails delegation, etc.?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2013 Jun 26
1
unable to create ajax call in my rails app , any help ??
hi all ,
I am unable to create ajax call in my rails app , any help ??
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit
2013 Sep 20
1
How to increase css and js file loading speed in rails 3 application
Hi all
Right now i am working on rails 3. Is there any possible way to increase
the css and js file loading speed .I tried bundle fu plugin.
Please help me
Regards
Chandrashekar
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
2013 Feb 28
1
Make `ActionView::Helpers::InstanceTag#tag_id`, `ActionView::Helpers::InstanceTag#tag_id_with_index(index)` public?
As I asked in StackOverflow<http://stackoverflow.com/questions/15127658/hoe-to-get-tag-id-from-a-record-in-form-for/15129741>
I think it would be helpful since we can dynamically create javascript code
to control each input tag in form helper, what do you think? Or there has
already been a solution?
--
You received this message because you are subscribed to the Google Groups "Ruby
2013 Jun 15
1
A puzzle about default_scope
Hi, guys
I have a puzzle about default_scope.
Suppose I have two model:
class User < ActiveRecord::Base
has_many :blogs
default_scope where(deleted_at: nil)
end
class Blog < ActiveRecord::Base
belongs_to :user
end
I want to produce sqlselect blogs.* from blogs inner join users on users.id
= blogs.user_id and users.deleted_at is null
And the code Blog.joins(:user), which I think