lib/jsonapi/resource.rb in jsonapi-resources-0.9.0.beta3 vs lib/jsonapi/resource.rb in jsonapi-resources-0.9.0

- old
+ new

@@ -654,11 +654,11 @@ *model_names, column_name = field.split(".") associations = _lookup_association_chain([records.model.to_s, *model_names]) joins_query = _build_joins([records.model, *associations]) - # _sorting is appended to avoid name clashes with manual joins eg. overriden filters + # _sorting is appended to avoid name clashes with manual joins eg. overridden filters order_by_query = "#{associations.last.name}_sorting.#{column_name} #{direction}" records = records.joins(joins_query).order(order_by_query) else records = records.order(field => direction) end @@ -999,10 +999,10 @@ model_name = _model_name return nil if model_name.to_s.blank? @model_class = model_name.to_s.safe_constantize if @model_class.nil? - warn "[MODEL NOT FOUND] Model could not be found for #{self.name}. If this a base Resource declare it as abstract." + warn "[MODEL NOT FOUND] Model could not be found for #{self.name}. If this is a base Resource declare it as abstract." end @model_class end