active_remote 6.0.1 → 6.0.3
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
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 29b348d56816a06e098fb8ef283d7d9f3033d9230bb1d066bd5dd15c8b3d100c
         | 
| 4 | 
            +
              data.tar.gz: 47c0439724a5c2257baef12c79e4dbfb7edee3b37b9f3d57ce8690ca5468a8f6
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 9c43053640f5cb2034379a5ef7ab0aae58c7923af36a4cb3c12058bec99e65e43b03701bbef2648cd3f60931ac66575492feed432d8d86fe5ad1b7bc879ade04
         | 
| 7 | 
            +
              data.tar.gz: a46eccb6bcb0fe675d48f50c280bc5385afa4d9453dc15834f452242c4ec4ce0c4e88ccfcafa1fc6bb46456b5b5c977f163bd11b4b6b2af1809a80c0db597457
         | 
| @@ -39,7 +39,7 @@ module ActiveRemote | |
| 39 39 | 
             
                      search_hash[:guid] = object.send(foreign_key)
         | 
| 40 40 | 
             
                      search_hash[options[:scope]] = object.send(options[:scope]) if options.key?(:scope)
         | 
| 41 41 |  | 
| 42 | 
            -
                      search_hash.values.any?(&:nil?) ? nil : klass.search(search_hash).first
         | 
| 42 | 
            +
                      search_hash.values.any?(&:nil?) ? nil : klass.search(**search_hash).first
         | 
| 43 43 | 
             
                    end
         | 
| 44 44 | 
             
                  end
         | 
| 45 45 |  | 
| @@ -80,11 +80,11 @@ module ActiveRemote | |
| 80 80 | 
             
                      search_hash[foreign_key] = object.guid
         | 
| 81 81 | 
             
                      search_hash[options[:scope]] = object.send(options[:scope]) if options.key?(:scope)
         | 
| 82 82 |  | 
| 83 | 
            -
                      search_hash.values.any?(&:nil?) ? [] : klass.search(search_hash)
         | 
| 83 | 
            +
                      search_hash.values.any?(&:nil?) ? [] : klass.search(**search_hash)
         | 
| 84 84 | 
             
                    end
         | 
| 85 85 |  | 
| 86 86 | 
             
                    options[:has_many] = true
         | 
| 87 | 
            -
                     | 
| 87 | 
            +
                    create_association_writer(has_many_class, options)
         | 
| 88 88 | 
             
                  end
         | 
| 89 89 |  | 
| 90 90 | 
             
                  # Create a `has_one` association for a given remote resource.
         | 
| @@ -120,7 +120,7 @@ module ActiveRemote | |
| 120 120 | 
             
                      search_hash[foreign_key] = object.guid
         | 
| 121 121 | 
             
                      search_hash[options[:scope]] = object.send(options[:scope]) if options.key?(:scope)
         | 
| 122 122 |  | 
| 123 | 
            -
                      search_hash.values.any?(&:nil?) ? nil : klass.search(search_hash).first
         | 
| 123 | 
            +
                      search_hash.values.any?(&:nil?) ? nil : klass.search(**search_hash).first
         | 
| 124 124 | 
             
                    end
         | 
| 125 125 | 
             
                  end
         | 
| 126 126 |  | 
| @@ -133,12 +133,11 @@ module ActiveRemote | |
| 133 133 |  | 
| 134 134 | 
             
                private
         | 
| 135 135 |  | 
| 136 | 
            -
                  def  | 
| 137 | 
            -
                     | 
| 138 | 
            -
                    define_method(writer_method) do |new_value|
         | 
| 136 | 
            +
                  def create_association_writer(associated_klass, options = {})
         | 
| 137 | 
            +
                    define_method("#{associated_klass}=") do |new_value|
         | 
| 139 138 | 
             
                      raise "New value must be an array" if options[:has_many] == true && new_value.class != Array
         | 
| 140 139 |  | 
| 141 | 
            -
                      instance_variable_set(:"@#{ | 
| 140 | 
            +
                      instance_variable_set(:"@#{associated_klass}", new_value)
         | 
| 142 141 | 
             
                      new_value
         | 
| 143 142 | 
             
                    end
         | 
| 144 143 | 
             
                  end
         | 
| @@ -160,7 +159,7 @@ module ActiveRemote | |
| 160 159 | 
             
                      return value
         | 
| 161 160 | 
             
                    end
         | 
| 162 161 |  | 
| 163 | 
            -
                     | 
| 162 | 
            +
                    create_association_writer(associated_klass, options)
         | 
| 164 163 | 
             
                  end
         | 
| 165 164 | 
             
                end
         | 
| 166 165 | 
             
              end
         | 
| @@ -76,8 +76,10 @@ describe ActiveRemote::Association do | |
| 76 76 | 
             
                    expect(subject.coauthor).to eq record
         | 
| 77 77 | 
             
                  end
         | 
| 78 78 |  | 
| 79 | 
            -
                  it " | 
| 80 | 
            -
                     | 
| 79 | 
            +
                  it "creates a setter method" do
         | 
| 80 | 
            +
                    author = Author.new(:guid => author_guid)
         | 
| 81 | 
            +
                    subject.coauthor = author
         | 
| 82 | 
            +
                    expect(subject.coauthor).to eq(author)
         | 
| 81 83 | 
             
                  end
         | 
| 82 84 | 
             
                end
         | 
| 83 85 |  | 
| @@ -351,7 +351,7 @@ describe ::ActiveRemote::Persistence do | |
| 351 351 | 
             
                end
         | 
| 352 352 |  | 
| 353 353 | 
             
                it "updates a remote record" do
         | 
| 354 | 
            -
                  expect(rpc).to receive(:execute).with(:update, "name" => "foo", "guid" => "123")
         | 
| 354 | 
            +
                  expect(rpc).to receive(:execute).with(:update, {"name" => "foo", "guid" => "123"})
         | 
| 355 355 | 
             
                  tag.update_attribute(:name, "foo")
         | 
| 356 356 | 
             
                end
         | 
| 357 357 |  | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: active_remote
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 6.0. | 
| 4 | 
            +
              version: 6.0.3
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Adam Hutchison
         | 
| 8 | 
            -
            autorequire:
         | 
| 8 | 
            +
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2024-06-15 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: activemodel
         | 
| @@ -264,7 +264,7 @@ files: | |
| 264 264 | 
             
            homepage: https://github.com/liveh2o/active_remote
         | 
| 265 265 | 
             
            licenses: []
         | 
| 266 266 | 
             
            metadata: {}
         | 
| 267 | 
            -
            post_install_message:
         | 
| 267 | 
            +
            post_install_message: 
         | 
| 268 268 | 
             
            rdoc_options: []
         | 
| 269 269 | 
             
            require_paths:
         | 
| 270 270 | 
             
            - lib
         | 
| @@ -279,8 +279,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 279 279 | 
             
                - !ruby/object:Gem::Version
         | 
| 280 280 | 
             
                  version: '0'
         | 
| 281 281 | 
             
            requirements: []
         | 
| 282 | 
            -
            rubygems_version: 3. | 
| 283 | 
            -
            signing_key:
         | 
| 282 | 
            +
            rubygems_version: 3.4.6
         | 
| 283 | 
            +
            signing_key: 
         | 
| 284 284 | 
             
            specification_version: 4
         | 
| 285 285 | 
             
            summary: Active Record for your platform
         | 
| 286 286 | 
             
            test_files:
         |