Displaying 5 results from an estimated 5 matches for "missing_method".
2006 Jul 17
14
REST Relationship Models
I''m trying to figure out an elegant way to do this:
I have the following three tables:
people, employer, employees
And consequently the following three models:
class Person < ActiveRecord::Base
end
class Employer < ActiveRecord::Base
has_many :employees
end
class Employee < ActiveRecord::Base
belongs_to :person
belongs_to :employer
end
I want to be able to say:
2006 Mar 03
7
Meta Programming Help
I have the following two methods:
def ProductFile::find_images(mode, prod_id)
# convert to symbol in case it is not (most commonly it may be a String)
mode = mode.to_sym
case mode
when :all, :first
ProductFile::find(mode, :conditions => ["product_id = ? AND
file_type LIKE ?", prod_id, "image%"])
end
end
def ProductFile::find_documents(mode,
2010 Dec 10
3
Re: [Puppet-dev] Converting to Ruby DSL
On Dec 8, 2010, at 11:09 AM, Ken Barber wrote:
> (cross posting here as I originally posted in puppet-users - I figure the question is more of a dev one then for puppet-users)
>
> Hi everyone,
>
> I''m experimenting with converting some of my live puppet content to
> Ruby DSL and have found a few gaps I wouldn''t mind some advice on. I''m
> not sure
2006 Apr 20
7
Rails + postgres case insensitive searches.
Hello all
I am wondering how rails handles case sensitivity in databases. If I
do a Person.find_all_by_name("tim") in mysql I would expect to get
tim, TIm, and Tim. Do I only get tim in postgres?
How do other people deal with this? Do you resort to find_by_sql for
all your postgres queries to get case insensitive results?
2007 Nov 14
6
My own methods on model + "extends" problem?
Hello.
I have a UsersController and a Model called User with a "new" method,
like this:
class User < ActiveRecord::Base
def test
return 1 #I can do anything and return any data, the
problem continues.
end
end
The problem is that I cannot access my "test" function from the
controller. It says that the method doesn''t exists.
class