Displaying 6 results from an estimated 6 matches for "productcategory".
Did you mean:
product_category
2012 Feb 02
3
MVC questions with rails
2008 May 08
1
Eager loading of association extensions
Hello all,
Is it possible to do eager loading of association extensions?
That is, the following code produces one SQL query:
cat = ProductCategory.find(:first, :include => :pricing_rules)
cat.pricing_rules
But if in ProductCategory I have an association extension like this:
has_many :pricing_rules do
def applicable()
find(:all).select(&:applicable?)
end
end
the code
cat = ProductCategory.find(:first, :include...
2006 Apr 01
0
Newbie question: How to reference models in subdirectories
...els organised in subdirectories, i.e.
models
|--material
|--product.rb
|--cross-applications
|--currency.rb
When I try to reference another model within the same subdirectory,
everything works fine, i.e.
belongs_to :product_categories, :class_name =>
''Material::ProductCategory"
However, when I reference a model in a different subdirectory, I get an
uninitialized constant error, i.e.
belongs_to :currencies, :class_name => ''CrossApplications::Currency''
=>
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.0/lib/active_support/dependencies....
2007 Nov 05
6
Strange wildcard problem
Hi,
Apologies for reposting this for those who read this via ruby-forum,
but it didn''t make it to the list before, and the list seems more
active...
I''m using ferret (via acts_as_ferret) in a somewhat unorthodox
manner and am having a strange wildcard problem. Before anyone wonders
why we''re doing things this way, the answer is basically that it lets
us
2005 Nov 01
5
Strange error(s) on windows only
I have some strange behaviour on Windows XP boxes (the same code on
Linux doesn''t have the same behaviour). Ruby 1.8.2 and Rails 0.14.2.
I have a single inheritance table nodes with a base class Node
(acts_as_tree) and some subclasses such as PageNode and FolderNode. If I
render the tree in an iframe in a set of iframes it doesn''t work, if I
render it stand alone it works
2006 Nov 17
6
RESTful routes and resulting urls
if I have the following in my routes.rb:
map.resources :product_categories
it provides urls such as:
/product_categories
/product_categories/1
/product_categories/1;edit
etc.
and uses the ProductCategories controller.
how can I keep the same controller (and model) but set up the resources
so that I can have any abitrary url point to the existing controller,
much like specifying the controller