Displaying 20 results from an estimated 90 matches similar to: "[PATCH] (+tests) with_scope :order doesn''t work with included associations"
2006 Apr 28
2
Accessing fixtures from unit tests
I have set up some fixtures in test/fixtures/users.xml:
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
admin:
id: 1
username: admin
password: admin
pbarry:
id: 2
username: pbarry
I have a unit test for my user model:
require File.dirname(__FILE__) + ''/../test_helper''
class UserTest < Test::Unit::TestCase
fixtures :users
def
2006 Oct 05
0
Where to add ActiveRecord::Base#find! tests
Just looking at adding the ActiveRecord::Base#find! method that was
spoken about a while ago now, and just wondering what''s the best way
to add these tests in?
My problem is that for 75% of the tests in finder_test.rb [1] I also
want to ensure that find! or find_by_name! or find_by_sql! works
alongside the regular finds.
I can duplicate the tests:
def test_find
2015 Jul 29
2
[PATCH] ssh: Add option to present certificates on command line
Allow users to specify certificates to be used for authentication on
the command line with the '-z' argument when running ssh. For
successful authentication, the key pair associated with the certificate
must also be presented during the ssh.
Certificates may also be specified in ssh_config as a
CertificateFile.
This option is meant the address the issue mentioned in the following
2006 Jan 18
0
R Wiki and R-sig-wikii
Hello all,
This is to announce the creation of R-sig-wiki, a new R SIG (Special
Interest Group) mailing list dedicated to the elaboration and
maintenance of a R Wiki. You can subscribe at:
https://stat.ethz.ch/mailman/listinfo/r-sig-wiki. There is currently a
prototype for a new R Wiki at http://www.sciviews.org/_rgui/wiki
(temporary address). The main idea is to offer a site where users
2006 Jun 26
0
with_scope with new
Why does with_scope work with .create, .find, but not with .new? It
breaks all scaffolded code :(
--
Posted via http://www.ruby-forum.com/.
2006 Apr 01
1
STI with_scope on parent - bug or feature?
Hi,
It seems that setting a with_scope on the parent class doesn''t do anything
MyClass.with_scope(:find=>{:conditions=> ["somecol = ?", ''val'']}) do
@ext_pages, @ext_rows = paginate :my_extended_class, {
:per_page => 13
}
end
# this doesn''t generate WHERE somecol=''val''
In order for scope to work you have to call
2006 Apr 03
0
with_scope used in a has_many :through model
Hi there,
I have something like the following:
class Person < AR:B
...
...
has_many :votes
has_many :chosen_answers, :through => :votes, :source => :answer, :select => ''DISTINCT answers.*'' do
def my_answers(whodunnit)
chosen_answers.with_scope(:find => { :conditions => [ "votes.created_by=?", whodunnit ] }) do
chosen_answers.find :all
2006 Mar 02
0
EdgeRails with_scope and :select
>From what i can gather the with_scope feature doesn''t allow you to
specify which columns get selected. It appears to default to "*". So
if i specify something like:
Question.with_scope( :find => {
:from => "questions q, answers a",
:conditions => "q.owner = a.owner AND a.owner=1"
}) do
...
end
I''ll generate SQL like:
SELECT *
2006 Mar 30
4
with_scope and filters for Rails 1.1 (scoped_access plugin)
Has anyone successfully gotten the scoped_access[1] plugin to work in
Rails 1.1? Some of the methods it was relying on are now no longer
accessible. It seems the only way to add scope is to use the
''with_scope'' method that takes a block, but since Rails doesn''t have
real around filters[2] I cannot see a way of adding a scope using a
filter.
Anyone using with_scope
2010 Jan 27
1
around_filter and with_scope
i got two controller (with restful actions) where my code is quite
ugly and not very dry. every action looks quite like this:
if @logged_user.has_role?("admin")
User.find(params[:id)
else
@logged_user.group.user.find(params[:id])
this is a security check that enforce a simple spec: normal user
should read/write information only about their group''s users, but
2006 Jul 23
4
Anything like with_scope for ActionController?
There are areas of my application that "want" to use a url structure
like
domain/<human_readable_param>/<Module>/<Controller>/<Action>/<Id>
Please note that the human readable parameter I need to inject is NOT
related to the <id> being used by the action/controller pair. It''s
identifying a container object whose contains are operated
2002 Aug 24
0
selecting files from different subdirectories
Hi
I would need to synschronize some Netscape stuff to a server ("roaming
profiles" are not included anymore in the recent versions of Netscape).
In particular I'd like to synchronize bookmarks, address book and mail
filters.
So I need to synchronize ONLY the following three files (that are in the
mozilla directory work/mozilla) to the remote server (in the directory
2008 Jan 22
0
[CruiseControl] RubyOnRails build 8688 failed
The build failed.
CHANGES
-------
Revision 8688 committed by nzkoz on 2008-01-22 01:29:10
Add options missing from earlier changeset
M /trunk/activerecord/lib/active_record/test_case.rb
TEST FAILURES AND ERRORS
-----------------------
Name: test_ordering(FirstSecondHelperTest)
Type: Failure
Message: <"first mail"> expected but was
<"">.
2006 Jan 03
0
has_and_belongs_to_many include problem
hey,
i have users who are in groups, and i have a search form, where i can search on
group, user lastname, and user firstname.
All this is also with pagination.
these are my models
class User < ActiveRecord::Base
has_and_belongs_to_many :groups
end
class Group < ActiveRecord::Base
has_and_belongs_to_many :users
end
in my controller i do this
THIS works (but in need pagination)
@users2
2007 Oct 18
9
with_scope issue
I have the following code:
class User < ActiveRecord::Base
has_many :requests do
def find_active(options = {})
with_scope :find => { :conditions => ["requests.active = ?",
true] } do
find(:all, options)
end
end
end
end
Executing user.requests.find_active results in the following SQL:
SELECT * FROM requests WHERE (( requests.user_id = 10 ) AND
(
2007 May 31
0
Rails AR/SQLServer Unit Test: [6912] failed (but getting better)
"bitsweat" has given AR/SQLServer some love, but it''s still unhappy...
http://dev.rubyonrails.org/changeset/6912
------------------------------------------------------------------------
r6912 | bitsweat | 2007-05-31 10:15:56 -0700 (Thu, 31 May 2007) | 1 line
Fix an edge case with find with a list of ids, limit, and offset. Closes #8437.
2006 Nov 01
17
So how can I rewrite my app without using with_scope?
So, I hear that with_scope is going to be deprecated.
Which is a bit of a shame, given the stuff I''ve been writing recently.
I have a CMS with multiple clients. A ''client'' is essentially a
company, with multiple users. Content on the site belongs to a client
- content could be messages, images, schedules, etc etc. People
belonging to one client should not be able
2006 Jul 31
0
Patch for #3438: Eager loading doesn''t respect :order of associations
Hello all,
I still have a patch for #3438 (eager loading doesn''t respect
association orders); it passes all unit tests, and has additional unit
tests with full coverage. The patch is attached.
== The Bug ==
Author.find(1).posts != Author.find(1, :include => [:posts]).posts
if Author has_many :posts, :order => anything.
This means that either one must avoid eager loading or
2008 Jan 19
0
[CruiseControl] RubyOnRails build 8671 failed
The build failed.
CHANGES
-------
Revision 8671 committed by bitsweat on 2008-01-19 03:45:24
Support aggregations in finder conditions. Closes #10572.
M /trunk/activerecord/test/cases/finder_test.rb
M /trunk/activerecord/CHANGELOG
M /trunk/activerecord/lib/active_record/aggregations.rb
M /trunk/activerecord/lib/active_record/base.rb
TEST FAILURES AND ERRORS
-----------------------
2005 Feb 09
85
Introduce yourself and your project -- Round 2
On December 14th, 2004 David Heinemeier Hansson sent this to the mailing
list:
I''m seeing a lot of new names on the list. Could
we perhaps do a round of introductions? That would
also be a great first post, if you haven''t had a
chance to contribute yet. The basics should include
your name, your organization, your country and city,
and the project you''re