lib/avo/base_resource.rb in avo-2.8.0 vs lib/avo/base_resource.rb in avo-2.9.0
- old
+ new
@@ -3,10 +3,11 @@
extend ActiveSupport::DescendantsTracker
extend HasContext
include ActionView::Helpers::UrlHelper
include Avo::Concerns::HasTools
+ include Avo::Concerns::HasModel
include Avo::Concerns::HasFields
include Avo::Concerns::HasStimulusControllers
delegate :view_context, to: ::Avo::App
delegate :simple_format, :content_tag, to: :view_context
@@ -433,10 +434,14 @@
end
end
end
def route_key
- model_class.model_name.route_key
+ class_name_without_resource.underscore.pluralize
+ end
+
+ def singular_route_key
+ route_key.singularize
end
# This is used as the model class ID
# We use this instead of the route_key to maintain compatibility with uncountable models
# With uncountable models route key appends an _index suffix (Fish->fish_index)