In a Rails migration is there a way to see what the generated SQL would be
without running the migration?
(A bit like we can do with Arel now by writing Model.where(:id => 5).to_sql
)
William
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" gr
Yes I do. But still the problem is the difference in speed between running
the query in the MySql console and using MySql2 gem. At the moment I think
I might also be having a problem with a gem file. So slowly trying to
remove them to see if I can see one causing a problem.
--
You received
Hi Fred,
Yes I am pretty sure, because I write it out using to_sql before I run. At
the moment is seems like a Windows memory problem rather than a ruby
problem. As I commented on the StackOverflow thread I now have a solution
for my immediate problem. Since I am calculating averages over a d
Thanks, nice idea for installing ruby-prof. Never used it before and it's
extremely easy to install and use.
I'm on Windows so I needed to install with this command:
gem install ruby-prof --platform=mswin32 -v 0.8.1
I tried it on a simpler query and I give the top lines of the profile here.
Y
Has anyone experienced an ActiveRecord query being much much slower than
running the equivalent
query in the MySql console?
I am running a simple "group by" query with one condition on a table with 7
million records. When
I run EXPLAIN it says that it will have to scan over all the records - we
Hi Peter,
This works
get 'places/:lat/:lng' => 'places#index', :constraints => { :lat =>
/-?[.\d]+/, :lng => /-?[.\d]+/ }
I think it's just that the regular expression must match the whole text, and
you were just missing the '+' at the end.
William
--
You received this message because you ar
Ah, thanks, yes that will probably be the reason.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to
rubyonrails-talk+unsu
I am reading through some code in active_record/relation/query_methods - def
build_where (about line 230); and there are a couple of calls to send.
Here's the first one
[@klass.send(:sanitize_sql, other.empty? ? opts : ([opts] + other))]
and here's the second one
attributes = @klass.send(:expan
8 matches
Mail list logo