Assuming I have models that look like these:
class Job < ActiveRecord::Base
has_many :locations
end
class Location < ActiveRecord::Base
belongs_to :job
end
I have routes that look like this:
map.resources :job do |job|
job.resources :location
end
I’m exposing these model using ActiveResource like this:
class Job < MyLocalResource
end
class Location < MyLocalResource
site += ‘/job/:job_id’
end
How would I run a method on job, (like submitting the job to queue of
some sort) after I create location? Am I approaching this from the
wrong direction? Should I create an observer on the job model?