Displaying 20 results from an estimated 2000 matches similar to: "Dynamic finder conditions"
2006 Apr 16
3
variable variables?
Hi everyone,
Does Ruby support variable variables like PHP
(http://www.php.net/manual/en/language.variables.variable.php)? Or do I have
to use eval, like
some_hash.each_pair{|key, pair|
eval "#{key} = #{value}"
}
Or is there some other way?
I''m actually trying to figure this out in order to use ez_where to create
its conditions from a hash, so if this isn''t even
2006 Jun 20
3
return unique rows with finders
I''m looking through the api for something like find(:all, :distinct => true)
so that multiple instances of a row won''t be returned - is this possible?
Thanks!
2006 Apr 20
0
paginate :includes not working as I thought it should
Hello everyone, I have the code below:
paginator_options.merge!({:conditions => ''cities.id = 4'', :include =>
[:cities]})
@people_pages, @people = paginate :people, paginator_options
There''s a many-to-many relationship between people and cities.
It seemed like before this was working, but now in the sql that''s generated
the join table isn''t
2008 Feb 07
1
ActiveRecord 'find_or_initialize_by' dynamic finder bug? Ignoring conditions.
Hello all,
I just ran into something that I think is a bug, and I would like to
confirm with the core team whether this is expected/desired behavior
or if this is a bug that I should file and develop failing tests for
(I doubt I have the active record method_missing fu to actually patch
it).
Test Scenario:
I would like to find or initialize a new user and base the find on the
users email
2006 Apr 15
2
Can''t run MySQL queries
Hi everyone,
I''m having trouble actually running mysql queries. I can connect to the
database, I think, but when a query gets run the following shows up in my
log:
SQL (0.000000) Mysql::Error: Lost connection to MySQL server during
query: SHOW TABLES
Any suggestions?
Thanks!
Daniel Higginbotham
2006 May 25
16
yet another rails site - happycarpools.com
I''m pretty much done with a project I''ve been developing to learn Rails,
http://www.happycarpools.com . If you could take a look, that''d be awesome!
Feedback would be even more awesome!
Probably the coolest thing about making this has been seeing how Rails does
*so much* and hardly has any superfluous parts, if any. There are so many
features that I initially
2004 Sep 21
5
R 1.9.1 Fails to Start on WinXP SP2
I have two computers both of which are running Windows XP SP2. R 1.9.1
runs just fine on one but not the other. Both installations of R came
from the same installation package. When I click on the desktop icon an
hourglass shows up then disappears. Similarly, if I start RGUI the
process shows up in task-manager then abruptly disappears.
Interestingly, I can access R in Excel via the D(COM) Server
2006 Apr 16
12
tired of using defined? all the time
Hi everyone,
It seems like every time I want to evaluate a possibly undefined variable I
have to use defined? to see that it exists first, so I can''t simply have
-- if params[:range_start] > 3
or something like it. I need to have
-- if defined? params[:range_start] && params[:range_start] > 3
I can''t even have
-- if params[:range_start].nil?
This is really
2006 May 21
5
model methods
Hello everyone,
In my model, I have
def leave_at_formatted
leave_at.strftime("%I:%M %p")
end
I was wondering if there were any way to define to_s for leave_at in order
to get the same result?
Thanks!
2006 Apr 07
4
belongs_to and lookup tables
I have two classes, Listing and Warranty. A Listing (think of it as a
product) may or may not have a Warranty from a lookup table.
When I want the Warranty.company for a given Listing I want to say the
following:
@listing = Listing.find(4)
@company = @listing.warranty.company
In order to do that I did the following:
class Listing < ActiveRecord::Base
belongs_to :warranty
end
and
2008 Sep 23
0
Questions on Active Record SQL type Finders & Dynamic Finder
Hi,
I understand there are total 11 types of key Options for finding a
record.
The all 11 valid keys for the options hash are :conditions,
:include, :order, :select, :group, :joins, :from, :limit, :offset,
:readonly, and :lock.
We also have Dynamic Finders for the same. e.g. ... find_by etc...
I would like to know, how many types of dynamic finders, Active Record
provides, to match all those
2006 Mar 14
5
GROUP BY and SUM
I have orders, order_items, and products.
I want to collate several orders so that I can get a SUM of quantities
ordered for each product etc.
Can I say something like (the below gives an error on :sum, and ignores
:group)
OrderItem.find(:all, :sum => ''quantity'', :group => ''product_id'',
:include => [:order, :product])
I want to get back a
2015 Jun 17
0
macos finder error 36 when copy folder to samba 4.2.2
Am 17.06.2015 um 09:11 schrieb Sascha Kasch:
> dear list,
>
> encountered a problem and hopefully someone more experienced might
> help me.
> problem is with macos 10.9.5 and finder.
>
> i want to copy a simple folder with subfolders and without any files
> to my samba share.
> files alone work flawlessly.
>
> when i drag a folder from desktop to the share the
2006 Apr 13
1
FerretHelper module and Ferret Finder utility
Hi
I''ve written ferret_helper.rb (FerretHelper module) containing wrapper
methods
for converting PDF, HTML, Open Document and Microsoft Word files to
plain text
for the Ferret index analysers.
To help test it I wrote a simple ff.rb (Ferret Finder) command-line
utility to
index and search document files.
You can download the code at http://www.methods.co.nz/ff/
Cheers, Stuart
--
2015 Jun 16
0
macos finder error 36 when copy folder to samba 4.2.2
dear list,
encountered a problem and hopefully someone more experienced might help me.
problem is with macos 10.9.5 and finder.
i want to copy a simple folder with subfolders and without any files to
my samba share.
files work flawlessly.
when i drag a folder from desktop to share the finder errors out with
error -36 but creates all folders.
same happens when i copy an empty folder from the
2006 Apr 13
2
Automatic finder
It looks rails automatically creates a "finder" method on models that have a "belongs_to". So I tried this in the console:
c = Category.find(2)
chunks = Chunk.find_by_category(c)
chunks is always returned as an empty array. When I know have some chunks with a category_id of 2.
Should the find_by_category do what I think it should be doing or am I completely off base?
2015 Jun 18
0
macos finder error 36 when copy folder to samba 4.2.2
On Thu, Jun 18, 2015 at 09:51:28AM +0200, Sascha Kasch wrote:
> Am 17.06.2015 um 14:39 schrieb Sascha Kasch:
> >Am 17.06.2015 um 09:11 schrieb Sascha Kasch:
> >>dear list,
> >>
> >>encountered a problem and hopefully someone more experienced might help
> >>me.
> >>problem is with macos 10.9.5 and finder.
> >>
> >>i want to
2006 Jan 20
1
Tiger 10.4.4 Finder hangs browsing over VPN
On Friday, 29 Jul 2005, Brian Daniels wrote under [Samba] Samba, VPN,
and Mac OSX 10.4.2:
> After upgrading to Tiger, [our Mac OS X systems] still work fine
> when on our LAN. But if they try to connect to a [Samba 3.0.10-1]
> share over the [IPsec] VPN, Finder hangs. The Mac logs the
> following messages in /var/log/system.log during the hang:
>
> Jul 29 09:59:46
2006 Nov 06
2
Eager Finder SQL
Hi, I just uploaded a Rails plugin that allows you to specify custom
SQL when doing a find with associations (AKA eager loading).
One of the problems I encountered when implementing the Chacha
Underground (http://underground.chacha.com) was being able to use
queries provided by the DBA to efficiently get all the informaion I
needed to render a page. In some cases, I needed to go two or three