Displaying 20 results from an estimated 300 matches similar to: "straight join in rails"
2010 Oct 25
1
A few fixes to eager loading issues
Hey all,
I''d really appreciate some eyes on https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/5845-activerecord-3-eager-loading-fail#ticket-5845-19. There''s a small issue in Rails 3 eager loading, and this ticket has an accompanying patch.
Sssociations that show up twice in a Relation chain like:
Article.includes(:comments).includes(:comments =>
2007 Feb 13
3
"should.be_in [values]" and "each_should_satisfy"
Hi!
I just started using RSpec and have some question that I couldn''t find
answers to.
If I have a result that can have two valid values, is there a better way
of writing
the following assertion?
[value1,value2].should_include actual
Is there a more elegant way of performing should_satisfy on a
collection, for
example I currently use something like collection.each {|x|
2006 Mar 01
5
single transaction migrations
Hi!
It seems that migration doesn''t use single transcation to execute the
needed migrations for the database upgrade, so if I have database at
version 5, and I wrote some migrations 6..10, and error occurs while
executing migration 7, the database stays in state 6?
I also think that migration taks could use some more verbosity, for
example if migration fails, there''s no
2007 Jul 19
1
stopping on first failure
Hi!
Is there an option that I could provide to the spec runner that would
make it stop after it
encounters the first spec that fails?
Esad
2007 Feb 20
1
having should_receive expectation for things that happen in setup
Hi!
The following example doesn''t work for me: http://pastie.caboo.se/41732
However, if the call to msg() happens in the specify block after the
expecation and not in the setup, it will pass.
Why is this? I thought the setup method was there to actually
''construct'' the context and the specifications are some kind of
"postconditions" that only need to be
2006 Feb 17
1
foreign key support in mysql adapter
Hi!
I''m using Migration to define my database schema and these "ALTER TABLE
t ADD FOREIGN KEY..." look really ugly - that''s why I wanted to ask it
would be possible to simply add add_foreign_key method to ActiveRecord?
Are there any reasons this isn''t yet implemented?
Greetings,
Esad
--
Posted via http://www.ruby-forum.com/.
2007 Apr 13
1
File.should be_exist?
Hi!
Is there a nicer way of writing
File.should be_exist(''filename'')?
File.should exist(''foo'') throws NoMethodError in ''specification''
undefined method `exist'' for #<#<Class:0x3ec1c30>:0x3ebc308>
(I''m using rspec from the trunk)
Esad
2007 Apr 04
1
pontential bug in rspec_on_rails and ActiveRecord transactions
Hello rspec-users,
I''ve encountered a strange bug in rspec, but it may be me who is wrong.
I''m running latest version from the trunk (r1678) of both rspec and
rspec_on_rails.
Please consider the following model:
class Url < ActiveRecord::Base
def after_save
Contact.create!(:primary_email => ''user at example.com'')
raise
2006 May 08
4
rake db:migrate
Would it make sense for rake db:migrate to support creating databases if
it is not found, with blessing from user to prevent typos, or as an
additional command line switch.
Or am I just being too lazy?
--
Posted via http://www.ruby-forum.com/.
2006 Mar 07
1
decorators for models?
Hi!
I''m thinking of implementing datagrid like functionality for showing
data (models) in grids so that I don''t have to re-invent the
view/controller for each table I need. There are number of parameters
that need to be customizable: column titles, row style depending on the
data (i.e. showing all rows with balance<0 in red), is column sortable,
sort-algorithm etc.
To
2006 May 11
1
rendering in after_filter
Hi!
Is it possible to render the action within the after_filter method, or
is the rendering performed before?
I have something like this:
class FooController
after_filter :send
def a
@content=...
end
def b
@content=..
end
protected
def send
send_data(@content,...)
end
end
However, when calling the action a or b, the @content doesn''t get sent,
but instead
2006 Mar 21
1
including templates/views in plugins
Hi!
I''m writing a datagrid plugin and would like to render the datagrid
using a .rhtml template. However, I''d like to avoid placing this
template in app/views/shared, but it should reside somewhere within
vendor/plugins/datagrid/...
Any ideas?
--
Posted via http://www.ruby-forum.com/.
2008 Nov 12
5
dynamic condition for has_one and eager loading issue
Hi,
I ve defined the following relation in one of my models with a dynamic
where condition:
has_one :selection,
:foreign_key => ''object_id'',
:conditions => ''selection_type = 1 and account_id = #
{self.send(:account_id)}''
That works perfect, however when I try to eager load that relation I
am getting the following error when doing a
2007 Apr 17
7
rspec with CI
I am a bit of a rails and rspec noob.
I am trying to use rspec in conjunction with CruiseControlrb.
When I run a cruise build having spec errors, the build does not
indicate a failure. I have tried to track down why this is the case,
and my best guess is that the spec task is kicking off the spec via a
ruby() method in rake, and that ruby method does not propagate my spec
failure back to
2006 May 20
1
RJS returned javascript written straight to page
hi there,
I have in my controller, the following to catch a link_to_remote:
def form_part_add_personnel
@credit_types = CreditType.find(:all)
p = Credit.new()
p.id = rand.to_s[2..-1]
render :update do |page|
page.insert_html :bottom,
"script",
:partial => ''films/form/personnel'',
2007 Aug 29
0
xml builder using straight xml within the rxml template
I was wondering how can I insert straight xml, ie "<a>test</a>" inside
the builder syntax.
For example, i want to be able to do something like this
xml.A do
xml.B do
"<a>test</a>"
end
end
should give:
<A>
<B>
<a>
test
</a>
</B>
</A>
Anybody have a clue on this one?
--
2005 Sep 06
1
one extension goes straight to voicemail, others don't
i have one extension going straight to voicemail, while others that are
configured identically don't, so i don't think it's an overall config
problem. nor do i think it's a callerID problem. maybe it's an enduser
operation that i can't find documentation on?
che*CLI>
-- Starting simple switch on 'Zap/48-1'
-- Executing Macro("Zap/48-1",
2005 May 13
0
Extension never ring, goes straight to VM
I installed a new * server and copied the sip.conf and extensions.conf
from my existing setup to the new box. I created my outbound trunk
with a different broadvoice account and am able to dial out without
issue. I am able to dial all extensions but I go straight to voicemail
without any ringing, this happens to both local and outside numbers
calling my extensions. I have the correct firewall
2005 Jul 22
0
No caller ID, straight to voicemail
Hi,
I am having a problem with inbound calls (from a SIP VIOP provider).
When caller ID information is not available, the calls go straight to
voicemail. We are using a mix of either Sipura 841 phones or SPAs.
When the call is passed to the phone/SPA, Asterisk reports "Got SIP
Response 406 "Not Acceptable" back from..."
I have searched a while now and can't seem to
2008 Dec 22
1
Is there a straight forward way to associate login with imap process
Hi,
Is there a way to associate a user's the login (imap-login) process with
the user's 'imap [' process? We are trying to lock down an issue to
make sure we full understand it. /proc and shared memory tools weren't
particular useful.
Just for context, we are having an intermittent locking index cache
locking issue that appears to impact only a subset of our users. The