using a before_save doesn't help?

Antonin Kral wrote:
> Hello,
> 
> I am pretty new to AS, so I would not be probably exact in terms. I
> have following 'setup':
> 
> class Customer < ActiveRecord::Base
>   belongs_to :company
> end
> 
> class Company < ActiveRecord::Base
>   has_many :customers
> end
> 
> class CustomersController < ApplicationController
>   active_scaffold :customer do |config|
>     config.label = "Customers"
>   end
> end
> 
> I am trying to limit what would be accessible by /customers/ as if
> association like Company.find_by_id(1).customers is used. It looks
> like that :constraints => {:company_id => 1} is what I am looking for,
> but I don't want to use embedded AS as far as I want to have specific
> customer resource (and I am on rails 2.3.2 so there are another
> problems).
> 
> def conditions_for_collection
> end
> 
> doesn't help, because e.g. new entries are not created through
> association, so they would not inherit the proper constraint.
> 
> Thank a lot,
> 
>    Antonin
> 
> 
> > 

-- 
-Mike Gaffney (http://rdocul.us)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to