linked_rails 0.0.4.pre.g4c8e21c9f → 0.0.4.pre.g8d7195543
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/app/controllers/linked_rails/bulk_controller.rb +3 -1
 - data/app/models/linked_rails/actions/item.rb +1 -1
 - data/app/models/linked_rails/collection/view.rb +4 -3
 - data/app/models/linked_rails/form/field_factory.rb +1 -7
 - data/app/models/linked_rails/manifest.rb +1 -1
 - data/app/models/linked_rails/menus/item.rb +1 -1
 - data/app/serializers/linked_rails/collection/view_serializer.rb +1 -0
 - data/lib/linked_rails/helpers/resource_helper.rb +4 -1
 - data/lib/linked_rails/iri_mapper.rb +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 52592ddbab37c67682af36b68c3937b75e30ef3d2524572061c8b1e7b8b33f43
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 93f154436fc269dcff4ad704f3813f9ec2c708bb3544a88dd902416faf6b2ac8
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 7c34836c7195df7ad3de8f38f97dbcdc82eea1cd13a3928693dba0622e0d81b9ffc7b511ac10244e8199ac62874fe1f3c4a9eca3babd7403e986cc3b6c200487
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 6ef666de7b7212f973f369b1bafbbe60ec2fe79602c7f6e9df8264f00ae2b391d097667e7314e30c9c2e924d716282cdcec0a9323fb9c08bbf37d0779b06de99
         
     | 
| 
         @@ -98,6 +98,8 @@ module LinkedRails 
     | 
|
| 
       98 
98 
     | 
    
         
             
                  params = param.permit(:include, :iri)
         
     | 
| 
       99 
99 
     | 
    
         
             
                  params[:iri] = URI(params[:iri])
         
     | 
| 
       100 
100 
     | 
    
         
             
                  params
         
     | 
| 
      
 101 
     | 
    
         
            +
                rescue URI::InvalidURIError
         
     | 
| 
      
 102 
     | 
    
         
            +
                  params.except(:iri)
         
     | 
| 
       101 
103 
     | 
    
         
             
                end
         
     | 
| 
       102 
104 
     | 
    
         | 
| 
       103 
105 
     | 
    
         
             
                def resource_response_body(iri, rack_body, status)
         
     | 
| 
         @@ -249,7 +251,7 @@ module LinkedRails 
     | 
|
| 
       249 
251 
     | 
    
         | 
| 
       250 
252 
     | 
    
         
             
                def sanitized_relative_path(iri) # rubocop:disable Metrics/AbcSize
         
     | 
| 
       251 
253 
     | 
    
         
             
                  iri.path = "#{iri.path}/" unless iri.path&.ends_with?('/')
         
     | 
| 
       252 
     | 
    
         
            -
                  uri = URI(LinkedRails.iri.path.present? ? iri.to_s.split("#{LinkedRails.iri.path}/").last : iri)
         
     | 
| 
      
 254 
     | 
    
         
            +
                  uri = URI(LinkedRails.iri.path.chomp('/').present? ? iri.to_s.split("#{LinkedRails.iri.path}/").last : iri)
         
     | 
| 
       253 
255 
     | 
    
         | 
| 
       254 
256 
     | 
    
         
             
                  [uri.path, uri.query].compact.join('?')
         
     | 
| 
       255 
257 
     | 
    
         
             
                end
         
     | 
| 
         @@ -187,7 +187,7 @@ module LinkedRails 
     | 
|
| 
       187 
187 
     | 
    
         | 
| 
       188 
188 
     | 
    
         
             
                  def target_url_fallback # rubocop:disable Metrics/AbcSize
         
     | 
| 
       189 
189 
     | 
    
         
             
                    base = (resource.try(:singular_resource?) ? resource.singular_iri : resource.iri).dup
         
     | 
| 
       190 
     | 
    
         
            -
                    base.path = "#{base.path}/#{target_path}" if target_path.present?
         
     | 
| 
      
 190 
     | 
    
         
            +
                    base.path = "#{base.path.chomp('/')}/#{target_path}" if target_path.present?
         
     | 
| 
       191 
191 
     | 
    
         
             
                    base.query = Rack::Utils.parse_nested_query(base.query).merge(target_query).to_param if target_query.present?
         
     | 
| 
       192 
192 
     | 
    
         
             
                    base
         
     | 
| 
       193 
193 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -8,8 +8,9 @@ module LinkedRails 
     | 
|
| 
       8 
8 
     | 
    
         
             
                  include LinkedRails::Model
         
     | 
| 
       9 
9 
     | 
    
         | 
| 
       10 
10 
     | 
    
         
             
                  attr_accessor :collection, :filter
         
     | 
| 
       11 
     | 
    
         
            -
                  delegate :apply_scope, :association_base, :association_class, : 
     | 
| 
       12 
     | 
    
         
            -
                           :parent, :policy, :total_page_count, :unfiltered_collection, :user_context, 
     | 
| 
      
 11 
     | 
    
         
            +
                  delegate :apply_scope, :association_base, :association_class, :child_resource, :default_page_size, :display,
         
     | 
| 
      
 12 
     | 
    
         
            +
                           :include_members,:parent, :policy, :total_page_count, :unfiltered_collection, :user_context,
         
     | 
| 
      
 13 
     | 
    
         
            +
                           to: :collection
         
     | 
| 
       13 
14 
     | 
    
         
             
                  delegate :count, to: :members
         
     | 
| 
       14 
15 
     | 
    
         | 
| 
       15 
16 
     | 
    
         
             
                  alias id iri
         
     | 
| 
         @@ -42,7 +43,7 @@ module LinkedRails 
     | 
|
| 
       42 
43 
     | 
    
         
             
                  end
         
     | 
| 
       43 
44 
     | 
    
         | 
| 
       44 
45 
     | 
    
         
             
                  def preview_includes
         
     | 
| 
       45 
     | 
    
         
            -
                    include_members ?  
     | 
| 
      
 46 
     | 
    
         
            +
                    include_members ? %i[members] : []
         
     | 
| 
       46 
47 
     | 
    
         
             
                  end
         
     | 
| 
       47 
48 
     | 
    
         | 
| 
       48 
49 
     | 
    
         
             
                  def title
         
     | 
| 
         @@ -52,13 +52,7 @@ module LinkedRails 
     | 
|
| 
       52 
52 
     | 
    
         
             
                  private
         
     | 
| 
       53 
53 
     | 
    
         | 
| 
       54 
54 
     | 
    
         
             
                  def attr_column(name)
         
     | 
| 
       55 
     | 
    
         
            -
                     
     | 
| 
       56 
     | 
    
         
            -
                      if model_class.is_delegated_attribute?(name)
         
     | 
| 
       57 
     | 
    
         
            -
                        model_class.class_for_delegated_attribute(name)
         
     | 
| 
       58 
     | 
    
         
            -
                      else
         
     | 
| 
       59 
     | 
    
         
            -
                        model_class
         
     | 
| 
       60 
     | 
    
         
            -
                      end
         
     | 
| 
       61 
     | 
    
         
            -
                    column_model.column_for_attribute(name)
         
     | 
| 
      
 55 
     | 
    
         
            +
                    model_class.column_for_attribute(name)
         
     | 
| 
       62 
56 
     | 
    
         
             
                  end
         
     | 
| 
       63 
57 
     | 
    
         | 
| 
       64 
58 
     | 
    
         
             
                  def attr_to_datatype # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength
         
     | 
| 
         @@ -41,7 +41,7 @@ module LinkedRails 
     | 
|
| 
       41 
41 
     | 
    
         
             
                def blob_preview_iri
         
     | 
| 
       42 
42 
     | 
    
         
             
                  return unless ActiveStorage::Blob.service.present?
         
     | 
| 
       43 
43 
     | 
    
         | 
| 
       44 
     | 
    
         
            -
                  "#{LinkedRails.iri(path: 'rails/active_storage/blobs/redirect')}/{signed_id}/preview 
     | 
| 
      
 44 
     | 
    
         
            +
                  "#{LinkedRails.iri(path: 'rails/active_storage/blobs/redirect')}/{signed_id}/preview"
         
     | 
| 
       45 
45 
     | 
    
         
             
                end
         
     | 
| 
       46 
46 
     | 
    
         | 
| 
       47 
47 
     | 
    
         
             
                def blob_upload_iri
         
     | 
| 
         @@ -58,7 +58,10 @@ module LinkedRails 
     | 
|
| 
       58 
58 
     | 
    
         
             
                  end
         
     | 
| 
       59 
59 
     | 
    
         | 
| 
       60 
60 
     | 
    
         
             
                  def new_resource_from_parent
         
     | 
| 
       61 
     | 
    
         
            -
                     
     | 
| 
      
 61 
     | 
    
         
            +
                    if requested_resource.is_a?(LinkedRails.collection_class) ||
         
     | 
| 
      
 62 
     | 
    
         
            +
                      requested_resource.is_a?(LinkedRails.collection_view_class)
         
     | 
| 
      
 63 
     | 
    
         
            +
                      return requested_resource.child_resource
         
     | 
| 
      
 64 
     | 
    
         
            +
                    end
         
     | 
| 
       62 
65 
     | 
    
         | 
| 
       63 
66 
     | 
    
         
             
                    parent_resource.build_child(
         
     | 
| 
       64 
67 
     | 
    
         
             
                      controller_class,
         
     | 
| 
         @@ -38,7 +38,7 @@ module LinkedRails 
     | 
|
| 
       38 
38 
     | 
    
         
             
                    params = Rails.application.routes.recognize_path(iri.to_s, method: method)
         
     | 
| 
       39 
39 
     | 
    
         | 
| 
       40 
40 
     | 
    
         
             
                    route_params_to_opts(params.merge(query), iri.to_s)
         
     | 
| 
       41 
     | 
    
         
            -
                  rescue ActionController::RoutingError
         
     | 
| 
      
 41 
     | 
    
         
            +
                  rescue ActionController::RoutingError, SystemStackError
         
     | 
| 
       42 
42 
     | 
    
         
             
                    EMPTY_IRI_OPTS.dup
         
     | 
| 
       43 
43 
     | 
    
         
             
                  end
         
     | 
| 
       44 
44 
     | 
    
         | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: linked_rails
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.0.4.pre. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.4.pre.g8d7195543
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Arthur Dingemans
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2022-08- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2022-08-24 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: active_response
         
     |