Displaying 20 results from an estimated 3000 matches similar to: "#content_column and polymorphic columns"
2007 Mar 19
0
PGError "unknown column" on polymorphic association column
Hi all !
This is very strange. I am attempting to get my application running
on PostgreSQL (from MySQL), and I get this error:
ActiveRecord::StatementInvalid: PGError: ERREUR: la colonne «Party»
n'existe pas
: SELECT * FROM contact_routes WHERE (routable_type = "Party" AND
routable_id = 1000013) ORDER BY position DESC LIMIT 1
2007 Apr 12
0
Does Ferret have problems with #alias_method_chain ?
Hi all,
I have this in my class:
class Party < AR::B
acts_as_ferret :store_class_name => true, :remote => true,
:fields => (self.content_columns.map(&:name) rescue []) +
%w(main_identifier)
class << self
# #count is also defined, omitted for clarity
def find_with_destroyed_scope(*args)
with_destroyed_scope do
2006 Dec 08
2
Windows Tempfile Fix Plugin
Hi all,
Yesterday, I had some problems reading JPG files in my tests. Turns
out the problem was that Windows Ruby doesn't set it's Tempfile to
work in binary mode. Since I deploy on Linux, that has never been a
big problem, but now I'm working on some software that works with
binary files exclusively.
Anyway, I am making this fix available as a Rails plugin.
The details can be
2006 Dec 08
2
Windows Tempfile Fix Plugin
Hi all,
Yesterday, I had some problems reading JPG files in my tests. Turns
out the problem was that Windows Ruby doesn't set it's Tempfile to
work in binary mode. Since I deploy on Linux, that has never been a
big problem, but now I'm working on some software that works with
binary files exclusively.
Anyway, I am making this fix available as a Rails plugin.
The details can be
2007 Mar 27
1
Ticket #7124
http://dev.rubyonrails.org/ticket/7124
I just attached a patch against 1.2 that cleanly applies to trunk too.
This allows functional and integration tests to have the same
interface to the xhr/xml_http_request method. The patch also includes
a deprecation workaround when called without the appropriate
parameters.
If the patch could also be applied to the 1.2 branch, I would appreciate.
The
2007 Feb 06
2
Testing RJS actions
Hi all !
This is my test:
def test_destroy_xhr
Article.expects(:find).with("1").returns(@article = mock("article"))
@article.expects(:destroy).returns(true)
delete :destroy, :id => 1, :format => :js
assert_template "destroy.rjs"
end
And my implementation:
def destroy
@article.destroy
respond_to do |format|
format.html {
2006 Sep 08
1
has_many relationship extensions and scoping rules
Hi all !
Is this supposed to work ?
class Email < ActiveRecord::Base
has_many :to, :class_name => 'Recipient', :conditions =>
"recipients.source = 'to'" do
def create!(*args)
with_scope(:create => {:source => 'to'}) do
super
end
end
def build(*args)
with_scope(:create => {:source => 'to'}) do
2007 Apr 03
5
Inifinite loop problem with DRb server
Hi all,
We''re attempting to use Ferret with the DRb server at the moment, and
it doesn''t work, at all...
= Executive Summary
The DRb server process keeps on calling the remote index to the DRb
server process... Which means DRb is calling itself, and itself, and
itself, until Ruby kills the Thread with a SystemStackLevel error.
= The excruciating details...
# Mongrel is
2007 Jan 29
2
Cryptic error message when no controller_name
Hi !
In the following spec:
context "A project owner" do
specify "can assign roles to other users" do
# ...
end
end
I get the following cryptic error message:
1)
NoMethodError in ''A project owner can assign roles to other users''
undefined method `session='' for #<Object:0xb741bed4>
2007 Apr 06
2
Advantages of using :single_index ?
Hi all,
Google returns two results for this:
http://www.google.ca/search?q=acts_as_ferret+shared_index+option&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:fr:official&client=firefox-a
Both point to the ChangeLog, so I don''t really know if anybody used a
shared index. From the RDoc, I know the option makes AAF "use a
Ferret index that is shared by all classes..."
2006 Nov 28
2
Partial matches in expectations
Hi !
I would like to ascertain the following in a test case:
@template.expects(:content_tag).with(:fieldset, :__any_arguments__i_dont_care)
Is it possible to do so ? If so how ? If not, is it something the
community wants ? Is it useful ?
Thanks !
--
Fran?ois Beausoleil
http://blog.teksol.info/
http://piston.rubyforge.org/
2007 May 17
4
How to mock helpers in view specs ?
Hi all,
I am mocking the following Rails view (inside a partial):
<%= render :partial => "forums/forum",
:collection => forum_category.forums.readable_by(current_user? ?
current_user : nil) %>
My spec fails with the following message:
1)
ActionView::TemplateError in ''forum_categories/index (anonymous user)
should only render forums accessible to anonymous
2006 Oct 25
2
Isn''t it possible to stub / expect on :id ?
Hi all !
Running this:
@payout = stub_everything(:id => 141)
Payout.stubs(:find).with(@payout.id).returns(@payout)
Generates this warning:
./test/functional/payouts_controller_test.rb:22: warning: Object#id
will be deprecated; use Object#object_id
What am I missing ? :id is a fairly frequent method to override in
Rails-based applications.
I''m using Mocha from
2007 Oct 05
2
Mongrel PID file permissions
Hi !
I''m using Mongrel 1.0.1 with --pid and --user/--group. The PID files
are correctly owned by the user/group, but their permissions is 0666.
Is that normal ? Shouldn''t it be something like 0664 ?
Just curious to know if I''m wrong.
Configurator has this (line 77):
# Writes the PID file but only if we''re on windows.
def write_pid_file
if
2007 Apr 06
0
Problem using a configuration file
Hi all,
I''m trying to start Mongrel using a configuration file, but Mongrel complains:
$ sudo mongrel_rails start --config
/usr/local/www/xltester.com/config/mongrel.yml
!!! Path to log file not valid: log/mongrel.log
mongrel::start reported an error. Use mongrel_rails mongrel::start -h
to get help.
I''m using sudo above to replicate monit, not because I run Mongrel as
root.
2007 Jan 29
0
mock.with(Hash) expects an Array ?
Hi all,
I looked at the open issues on the bug tracker, but couldn''t find
anything related to this. I also searched the archives. And I can''t
believe someone didn''t hit on this before.
Here''s my spec:
context "A project owner" do
controller_name :roles
setup do
controller.stub!(:current_user).and_return(@user = mock("user"))
2007 Jan 24
7
Differences between assert_tag and assert_select
Hi all,
I can't seem to make assert_select work for the more complex cases for me.
Here's a sample:
# View
<%= link_to_remote 'Add new', :url => new_phone_url, :submit => 'phones_head' %>
# Generated code:
<a href="#" onclick="new
Ajax.Request('http://test.host/admin/parties/phone/new',
{asynchronous:true, evalScripts:true,
2006 Jan 03
0
Automatically mapping content_columns?
Hi all,
Quick setup - I''ve got a table Foo. Foo has a foreign key (bar_id) to the
table Bar. The Bar table has an "id" and "name" column. Assume a 1:1
relationship.
The issue I''m trying to resolve (or rather, be lazy about) is with regards to
Foo.content_columns. By default it doesn''t pickup the foreign key. What I''m
wondering is if
2007 Jan 22
1
Observed models cause failures with DRBSpec ?
Hi all !
I don''t believe I am the only one using model observers, right ?
Well, here''s a nice one:
$ drbspec spec
.
Finished in 0.125322 seconds
1 specification, 0 failures
$ drbspec spec
F
1)
''A user with an inactive and an active project should be able to
return active projects only'' FAILED
[] should == [#<Spec::Mocks::Mock:0xb75590bc
2008 Jun 24
1
Get model from polymorphic association
Hi,
If using a polymorphic belongs_to, is it possible to access the "_type"
field that contains the name of the model ?
Thanks!
--
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