Displaying 20 results from an estimated 40000 matches similar to: "Mysql query optimization for order condition"
2010 Dec 09
15
Rails 3 Active Record query returns "undefined method `loaded?' for #<Array:0x126a4c>"
I am getting this error on an rspec test:
undefined method `loaded?'' for #<Array:0x126a4c>
When I call:
Practice.includes("practice_members").all
Practice has_many :practice_members
PracticeMember belongs_to :practice
Practice.all returns:
[#<Practice id: 6, name: "Practice One", created_at: "2010-12-09 15:40:46",
updated_at: "2010-12-09
2010 Jan 27
4
Better way to count Active Record Data?
I am trying to get hourly counts of orders between different price
ranges from my database. I''m thinking there has got to be a better way
than looping through each record and checking if the created_at time
fits between hour 1, 2, 3, 4, etc of the day and then returning the
count.
Currently I am displaying just a total of the days sales that are
between different dollar amounts this
2011 Jan 20
4
Comment.all returns array of what?
I have a bad feeling asking this but I did not manage to find an answer
myself :/
@comments = Comment.all
@comments is an array.
I can for example access comment.created_at directly, or I could do:
<% @comments.each do |comment| %>
<%= debug comment["created_at"] %>
<% end %>
I expected comment to be a hash, but comment.keys or comment.values fail, as
well as an
2011 Jan 13
9
[RVM,Ubuntu]ruby installed from rvm doesn't work
I''ve installed ruby1.9.2 from rvm
but ruby doesn''t work on my ubuntu
there is a picture showing my situation.
plase give me a help
http://postfiles4.naver.net/20110114_51/sukury47_1294944222409RbBlv_JPEG/rvm_break.JPG?type=w3
--
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
2010 Sep 07
2
Help on formatting some HAML
I wondered if anyone could help me with turning the following in ERB
into HAML. I''m VERY new with HAML:
----
<div class="block-element span-7 colborder">
<span class="rightside blue-hue no_decor"><%= link_to "New Order",
new_order_path, :remote => true %></span>
<h3>Today''s Activity</h3>
<hr>
2010 Aug 30
10
Trouble with rvm (Ruby Version Manager)
Hi--
Am having trouble with rvm. Successfully installed it, but when I
tried to install Ruby 1.8.7, here is the error I got:
Paul-Denlingers-MacBook-Pro:~ pdenlinger$ rvm install 1.8.7
-bash: rvm: command not found
Tried closing terminal, quitting terminal, opening another tab, etc.
but continued to get same error.
What to do?
Thanks!
--
You received this message because you are subscribed
2010 Dec 06
57
Which RoR to run on Mac OS X for a particular RoR app.
I am extremely new to RoR, I am. I am slowly but surely learning Ruby
and the Rails concepts but the environment is confusing.
I have an application that was written for my company in RoR. It is on a
ubuntu server that is going to be shut down. I want to move the app to
my two Macs (one Leopard and one Snow Leopard). We want to keep the app
to demo a business concept but it can run locally
2010 Jun 10
9
Rails3 beta4 + Ruby 1.9
When I try rails console using Rails3 beta4 and Ruby 1.9.1-p378 I
cannot save a record:
> rails console
Loading development environment (Rails 3.0.0.beta4)
ruby-1.9.1-p378 > g = Game.new
=> #<Game id: nil, player_id: nil, versus_id: nil, finished: nil,
created_at: nil, updated_at: nil>
ruby-1.9.1-p378 > g.save
NameError: undefined method `<=>'' for class
2010 Nov 18
7
Rails 3 ActiveRecord queries - I'm missing something very BIG
Hi,
I know I am missing something very big regarding the changes with
respect to activerecord in Rails 3.
I can''t find the explanation. And I''m sure someone will kick my ass for
not
finding the right piece of info in the docs and guides. Please do.
I have a working piece of code but I don''t like it.
So. Very basic association:
class Project < ActiveRecord::Base
2010 Oct 11
8
Nooby Stuck - "has_and_belongs_to_many" relationship
trying to set up a "has_and_belongs_to_many" relationship
would very much appreciate the help, not sure what im doing wrong at all.
Scheme.rb
class Scheme < ActiveRecord::Base
validates :schemename, :presence => true
belongs_to :user
has_many :levels, :dependent => :destroy
has_and_belongs_to_many :works
end
Work.rb
class Work < ActiveRecord::Base
2010 Nov 09
6
Upgrading to snow leopard
Hi All,
I''m currently mid-project at the moment, and am scepticle in upgrading
to Snow Leopard.
If I do, will it affect my current Ruby on Rails set up on my
machine??
Cheers
--
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
2010 Dec 06
10
testing chapter: agile web dev withrails
I am working my way through Agile web development with rails and I''m in
the testing chapter.
when I run the following test(or any other test)
I''m new and not sure where to start looking.
require ''test_helper''
class ProductTest < ActiveSupport::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end
I
2010 Jun 04
4
Mac OS/X and Rails 3 ?
Hello List,
Label me a newb, but how do you install Rails 3 on your Mac?
Google sent me to these URLs:
http://weblog.rubyonrails.org/2010/2/5/rails-3-0-beta-release/
http://guides.rails.info/3_0_release_notes.html
http://asciicasts.com/episodes/200-rails-3-beta-and-rvm
From early Feb 2010 I see this short recipe:
gem install tzinfo builder memcache-client rack rack-test rack-mount
erubis mail
2010 Dec 22
5
rvm, rails and sqlite
i need to use old version of ruby (1.8.7) and older version of rails
(2.1.0) so i decided to use rvm. however since i''m somewhat new to ruby
and rails i''m having issues. i created a gemset with rvm for my project,
installed rails 2.1.0 into it. after that i created a project and a
scaffolding for it. however i bumped onto an issue with sqlite3 (or
sqlite3-ruby). it seems to me
2010 Oct 02
6
Can't stop webrick with ctrl-c or ctrl-d on linux host
Hi All
I have setup a new dev system running LinuxMint 9 (Ubuntu 10.4). Running
ruby 1.9.2, rails 3.0, RVM etc.
One issue I have run into is that I can''t stop webrick with ctrl+c or ctrl+d
and killing the terminal always leaves a stranded ruby process.
Has anybody else run into this? Btw, webrick gets started by running "rails
s" in.
Also, ctrl+c works fine to stop a
2010 Dec 05
14
Remove bundler
Can you remove bundler without any problem – for rails?
--
Posted via http://www.ruby-forum.com/.
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
2010 Dec 06
15
Windows new installation - Always problems
I would like to know if there is a way to ''package'' an application
with all the associated gems and ship it to a new server and having it
to "just work" in a Windows environment.
Although I have never done it I know that Rails can be frozen into the
application. I am wondering if I can do the same thing with other
gems. I have found this
2010 May 09
7
"File not found: lib" installing rails-3.0.0.beta3 on my Mac
I''ve always distrusted the ruby and rails installs on my Mac (oOS X
10.6.3) -- sudo gem cleanup can''t seem to get rid of old gem versions
(lots of Gem::InstallError: cannot uninstall).
Because of that, I don''t trust the rails beta3 install I just
completed. Here''s the story:
* config is Apple''s ruby 1.8.7 and gem 1.3.6.
* xcode is installed from
2010 Aug 20
2
The M in ORM
Hi everyone,
I am attempting to connect an already existing mysql database with
Rails. For This I can''t use the traditional "generate scaffold" and
"rake db:migrate" because (I think), I''ll loose the data already
existing in that database table. So what I did was, I generated a
scaffold for my table, and instead of running db:migrate, I added a
2010 Dec 14
4
Change primary_key column name
Hi,
after changing a primary key column name, the auto-increment information
(MySQL) and sequence (Oracle) are lost. What is the correct way to rename
primary keys?
Thanks,
Gustavo
--
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