added filter criteria models

This commit is contained in:
Edin Dazdarevic
2015-02-07 14:48:02 +01:00
parent 0bb6bb5a49
commit ead0e87e31
25 changed files with 240 additions and 6 deletions

View File

@@ -0,0 +1,20 @@
get '/filter/section/:id' do |id_s|
# get filter criteria for a section with id
FilterCriteria.where(:owner_type => "Section").where(:owner_id => id_s.to_i).to_json(
:include => [:filter_criteria_values]
)
end
get '/filter/category/:id' do |id_s|
# get filter criteria for a category with id
FilterCriteria.where(:owner_type => "Category").where(:owner_id => id_s.to_i).to_json(
:include => [:filter_criteria_values]
)
end
get '/filter/subcategory/:id' do |id_s|
# get filter criteria for a subcategory with id
FilterCriteria.where(:owner_type => "Subcategory").where(:owner_id => id_s.to_i).to_json(
:include => [:filter_criteria_values]
)
end