Displaying 3 results from an estimated 3 matches for "find_all_by_typ".
Did you mean:
find_all_by_type
2006 Feb 15
10
STI Question
Hi everyone,
I have 3 types of people (for now):
Staff
Faculty
Students
To break them up into classes, but keep them in the same People table,
I''ve broken them up like so (code and ''ends'' snipped):
class Person < ActiveRecord::Base
class Employee < Person
class Staff < Employee
class Faculty < Employee
class Student < Employee
So, when I insert
2005 Dec 29
9
Single Table Inheritance
Hi all,
Quick question for STI. With the following setup:
class Company < AR::Base; end
class Firm < Company; end
Why does Firm.find(:all) return all Companies, not just those that have
type==''Firm''?
--
Alex
2006 May 24
10
Ferret slow after a while
...V''] ||= ''development''
puts "Environment : #{ENV[''RAILS_ENV'']}"
require ''config/environment.rb''
require ''ferret''
index = Ferret::Index::Index.new( :path => Node.class_index_dir, :create
=> true)
Node.find_all_by_type("PageNode").each { |content|
puts "ID: #{content.id} => name: #{content.title}"
index << content.to_doc if content.respond_to?("to_doc")
}
index.flush
index.optimize
index.close
--
Posted via http://www.ruby-forum.com/.