app/controllers/spree/api/states_controller.rb in solidus_api-1.2.3 vs app/controllers/spree/api/states_controller.rb in solidus_api-1.3.0.beta1
- old
+ new
@@ -18,16 +18,17 @@
@state = scope.find(params[:id])
respond_with(@state)
end
private
- def scope
- if params[:country_id]
- @country = Country.accessible_by(current_ability, :read).find(params[:country_id])
- return @country.states.accessible_by(current_ability, :read)
- else
- return State.accessible_by(current_ability, :read)
- end
+
+ def scope
+ if params[:country_id]
+ @country = Country.accessible_by(current_ability, :read).find(params[:country_id])
+ return @country.states.accessible_by(current_ability, :read)
+ else
+ return State.accessible_by(current_ability, :read)
end
+ end
end
end
end