brick 1.0.225 → 1.0.226
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/lib/brick/extensions.rb +3 -3
- data/lib/brick/rails/engine.rb +2 -2
- data/lib/brick/rails/form_tags.rb +11 -1
- data/lib/brick/version_number.rb +1 -1
- data/lib/brick.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: f49b4376a0265094ca854c558df6bc4166a619de70bb8b8306cee5667b3545fa
         | 
| 4 | 
            +
              data.tar.gz: 2230e3a409329ec8781aa92e976f4dca318727a1620b3814d1f382ef9e33502c
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: bd980b9c153b10d7b9298299553d552c1265b61cbd842fdd4814d6188a27dc101366fff42bf52cfa799f4a6304bb71e5b9505742b3fe606c41eef5309bd6d2e7
         | 
| 7 | 
            +
              data.tar.gz: b196a9a308e512f1faaea85982c6a738fe7bb00b70ef2d9e7eeff37638b01ca563696d85e1e82216b1358c2999cb9bfaf7e4081f012121c0266ebf8ff2f877d9
         | 
    
        data/lib/brick/extensions.rb
    CHANGED
    
    | @@ -459,7 +459,7 @@ module ActiveRecord | |
| 459 459 |  | 
| 460 460 | 
             
                    # join_array will receive this relation name when calling #brick_parse_dsl
         | 
| 461 461 | 
             
                    _br_bt_descrip[bt.first] = if bt[1].is_a?(Array)
         | 
| 462 | 
            -
                                                 # Last  | 
| 462 | 
            +
                                                 # Last param here:  "true" is for yes, we are polymorphic
         | 
| 463 463 | 
             
                                                 bt[1].each_with_object({}) { |bt_class, s| s[bt_class] = bt_class.brick_parse_dsl(join_array, bt.first, translations, true) }
         | 
| 464 464 | 
             
                                               else
         | 
| 465 465 | 
             
                                                 { bt.last => bt[1].brick_parse_dsl(join_array, bt.first, translations) }
         | 
| @@ -2278,8 +2278,8 @@ class Object | |
| 2278 2278 | 
             
                    end
         | 
| 2279 2279 |  | 
| 2280 2280 | 
             
                    self.protect_from_forgery unless: -> { self.request.format.js? }
         | 
| 2281 | 
            -
                    tn_start = ( | 
| 2282 | 
            -
                    plural_table_name =  | 
| 2281 | 
            +
                    tn_start = (pcn_split = plural_class_name.split('::')).length > 1 ? -2 : -1
         | 
| 2282 | 
            +
                    plural_table_name = pcn_split[tn_start..-1].join.underscore.pluralize
         | 
| 2283 2283 | 
             
                    singular_table_name = plural_table_name.singularize
         | 
| 2284 2284 | 
             
                    unless is_avo
         | 
| 2285 2285 | 
             
                      self.define_method :index do
         | 
    
        data/lib/brick/rails/engine.rb
    CHANGED
    
    | @@ -691,8 +691,8 @@ window.addEventListener(\"popstate\", linkSchemas); | |
| 691 691 |  | 
| 692 692 | 
             
                          if @_brick_model
         | 
| 693 693 | 
             
                            pk = @_brick_model._brick_primary_key(::Brick.relations.fetch((table_name = @_brick_model.table_name.split('.').last), nil))
         | 
| 694 | 
            -
                            rn_start = ( | 
| 695 | 
            -
                            obj_name =  | 
| 694 | 
            +
                            rn_start = (mn_split = model_name.split('::')).length > 1 ? -2 : -1
         | 
| 695 | 
            +
                            obj_name = mn_split[rn_start..-1].join.underscore.singularize
         | 
| 696 696 | 
             
                            res_name = obj_name.pluralize
         | 
| 697 697 |  | 
| 698 698 | 
             
                            path_obj_name = @_brick_model._brick_index(:singular)
         | 
| @@ -94,7 +94,17 @@ module Brick::Rails::FormTags | |
| 94 94 | 
             
                #     (After restarting the server it worked fine again.)
         | 
| 95 95 | 
             
                row_count = 0
         | 
| 96 96 | 
             
                # if @_brick_join_array&.include?()
         | 
| 97 | 
            -
                 | 
| 97 | 
            +
                begin
         | 
| 98 | 
            +
                  enumerator = relation.each # Runs the SQL query
         | 
| 99 | 
            +
                rescue ActiveRecord::SubclassNotFound => e
         | 
| 100 | 
            +
                  # If there is a missing STI class then keep the show on the road by temporarily modifying the inheritance column.
         | 
| 101 | 
            +
                  inh_col = klass.inheritance_column
         | 
| 102 | 
            +
                  puts "WARNING:  At least one row in the \"#{klass.table_name}\" table has an invalid value in the inheritance column \"#{inh_col}\"."
         | 
| 103 | 
            +
                  puts e.message
         | 
| 104 | 
            +
                  klass.inheritance_column = '^\/^' # Some impossible column name
         | 
| 105 | 
            +
                  enumerator = relation.each
         | 
| 106 | 
            +
                  klass.inheritance_column = inh_col
         | 
| 107 | 
            +
                end
         | 
| 98 108 | 
             
                # Add proxied info for @_brick_includes
         | 
| 99 109 | 
             
                # proxy = relation.instance_variable_get(:@proxy) || relation.instance_variable_set(:@proxy, {})
         | 
| 100 110 | 
             
                bi = relation.instance_variable_get(:@_brick_includes)
         | 
    
        data/lib/brick/version_number.rb
    CHANGED
    
    
    
        data/lib/brick.rb
    CHANGED
    
    | @@ -251,7 +251,7 @@ module Brick | |
| 251 251 | 
             
                        if (pri_models = (model.respond_to?(poly_types_method = "#{a.name}_types") &&
         | 
| 252 252 | 
             
                                          model.send(poly_types_method)
         | 
| 253 253 | 
             
                                         ) ||
         | 
| 254 | 
            -
                                         (rel_poly_bt = relations[model.table_name][:fks].find { |_k, fk| fk[:assoc_name] == a.name.to_s } &&
         | 
| 254 | 
            +
                                         ((rel_poly_bt = relations[model.table_name][:fks].find { |_k, fk| fk[:assoc_name] == a.name.to_s }) &&
         | 
| 255 255 | 
             
                                          (rel_poly_bt[1][:polymorphic] || rel_poly_bt&.last&.fetch(:inverse_table, [])&.map { |table| table.singularize.camelize })
         | 
| 256 256 | 
             
                                         )
         | 
| 257 257 | 
             
                           ).is_a?(Array)
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: brick
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.0. | 
| 4 | 
            +
              version: 1.0.226
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Lorin Thwaits
         | 
| 8 8 | 
             
            autorequire:
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2025-01- | 
| 11 | 
            +
            date: 2025-01-09 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: activerecord
         |