On 5 January 2012 18:09, Peter Vandenabeele 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 the problem of t
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
Thank you very much, Frederick, very useful!
I think I will go on with the first method (for starters)! :-)
Cheers,
Dmitry.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To view this discussion on the web visit
https://groups.google.c
And what if it is a large array of values?...
Ok to pass them as a contents of the tag?
I know I could do it with ajax request, but how do I pass this large amount
of data when JS is disabled...
What I'm doing is feeding data to jQuery Flot library.
And it accepts data in place of a plot initializ
Hello!
In rails 3.1 app I have a controller UsersController with 'show' action.
show.html.erb contains:
<% content_for(:head) do %>
<%= javascript_include_tag 'myscript' %>
<% end %>
Hello @user.name
And I have this in myscript.js.erb
$jQuery(document).ready(function() {
alert(<%= @user.name %>
Just for the record (in case anyone would search for the same thing):
See this thread for more info:
http://goo.gl/30nQF
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To view this discussion on the web visit
https://groups.google.com/
Wow, that matcher works indeed!
Thank you very much for analysis and for a solution!
On Wednesday, September 7, 2011 7:51:08 PM UTC+4, Ruby-Forum.com User wrote:
>
> The following tests *do* work as expected:
>
> describe "GET 'contact'" do
> it "should be successful" do
> { :get => 'p
Hi!
I'm running into issue which seems to indicate that
ActionController::TestCase.get() method ignores what I have in routes.rb.
Happens in 3.0.10 and 3.1.0 too.
I have the following RSpec2 test of my XmlRpcController#index action:
it "should get nothing in response to GET request" do
get :i
11 10:57:15 PM UTC+4, Frederick Cheung wrote:
>
>
>
> On Sep 6, 6:10 pm, Dmitry Suzdalev wrote:
> > Ah, I see.
> > Unfortunately I need exactly to call a count() method with left outer
> join
> > of another table
>
> If you want a join, why not us
Ah, I see.
Unfortunately I need exactly to call a count() method with left outer join
of another table
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonra
On Tuesday, September 6, 2011 7:12:05 PM UTC+4, Frederick Cheung wrote:
>
> From which version did you upgrade?
>
Upgraded from 3.0.10.
Before upgrading I ran all of my tests to ensure they pass.
After upgrading got a couple of test failures related to this issue...
> Part of the problem with
regression specific to Rails 3.1 and I should report this as
a bug upstream
If this is 2) I guess I should forward this to rails-core mailing list?...
On Monday, September 5, 2011 10:11:24 PM UTC+4, Dmitry Suzdalev wrote:
>
> Hello!
>
> Just upgraded to Rails 3.1, ran my test and foun
Hello!
Just upgraded to Rails 3.1, ran my test and found this issue:
class Trade < ActiveRecord::Base
has_many :transaction_trades
.
def Trade.do_something
stale_trades = Trade.count('transaction_trades.id',
:include => :transaction_trades,
13 matches
Mail list logo