act_as_fire_record_beta 0.0.8 → 0.0.10
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: 77d8ac84675d8ec650cb51876c7ba1517a403ea82f050827bd1974d75138bc31
         | 
| 4 | 
            +
              data.tar.gz: aca93cb508bf0ec6703c362ac5b9331ef940fd7fac61e766b1d57c27bfbbceec
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 295b47d79ef485aff5b03190f77d79b1de8b3abec2b80fbd6fe9fd8975efe0175d50f4927c94c1273441f8b81f8f894d858acb52cf1d44533318930cab95d037
         | 
| 7 | 
            +
              data.tar.gz: 90818791ea217adb7f026f00342302604a4de97bcf195f8e8f3a635c851fd4ab2f5bcb202d210878e8a583db8cd07d32b99dd43838714cc3b0ddd1faa2109a3a
         | 
    
        data/README.md
    CHANGED
    
    | @@ -68,13 +68,13 @@ Finder examples: | |
| 68 68 | 
             
            ```ruby
         | 
| 69 69 | 
             
            book = Book.find_by(title: 'An Awesome Book')
         | 
| 70 70 |  | 
| 71 | 
            -
            books = Book.all | 
| 71 | 
            +
            books = Book.all
         | 
| 72 72 |  | 
| 73 | 
            -
            books = Book.order(:title) | 
| 74 | 
            -
            books = Book.order(:title, :desc) | 
| 73 | 
            +
            books = Book.order(:title)
         | 
| 74 | 
            +
            books = Book.order(:title, :desc)
         | 
| 75 75 |  | 
| 76 | 
            -
            books = Book.where(:page, :>=, 200) | 
| 77 | 
            -
            books = Book.where(:page, :>=, 200).order(:page) | 
| 76 | 
            +
            books = Book.where(:page, :>=, 200)
         | 
| 77 | 
            +
            books = Book.where(:page, :>=, 200).order(:page)
         | 
| 78 78 | 
             
            ```
         | 
| 79 79 |  | 
| 80 80 | 
             
            Please refer test codes for other APIs.
         | 
| @@ -88,6 +88,10 @@ As of now, Japanese document is only available. | |
| 88 88 |  | 
| 89 89 | 
             
            [README-ja.md](https://github.com/JunichiIto/act_as_fire_record_beta/blob/main/README-ja.md)
         | 
| 90 90 |  | 
| 91 | 
            +
            Google translate might help you.
         | 
| 92 | 
            +
             | 
| 93 | 
            +
            [Auto-translated README-ja.md](https://github-com.translate.goog/JunichiIto/act_as_fire_record_beta/blob/main/README-ja.md?_x_tr_sl=ja&_x_tr_tl=en&_x_tr_hl=ja&_x_tr_pto=wapp)
         | 
| 94 | 
            +
             | 
| 91 95 | 
             
            ## Contributing
         | 
| 92 96 | 
             
            Contribution directions go here.
         | 
| 93 97 |  | 
| @@ -2,20 +2,45 @@ module Google | |
| 2 2 | 
             
              module Cloud
         | 
| 3 3 | 
             
                module Firestore
         | 
| 4 4 | 
             
                  class Query
         | 
| 5 | 
            -
                     | 
| 6 | 
            -
             | 
| 7 | 
            -
             | 
| 8 | 
            -
             | 
| 5 | 
            +
                    include Enumerable
         | 
| 6 | 
            +
             | 
| 7 | 
            +
                    def method_missing(sym, *args)
         | 
| 8 | 
            +
                      if respond_to_missing?(sym, false)
         | 
| 9 | 
            +
                        self.to_a.send(sym, *args)
         | 
| 10 | 
            +
                      else
         | 
| 11 | 
            +
                        super
         | 
| 12 | 
            +
                      end
         | 
| 13 | 
            +
                    end
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                    def respond_to_missing?(sym, _include_private)
         | 
| 16 | 
            +
                      [].respond_to?(sym) ? true : super
         | 
| 17 | 
            +
                    end
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                    def each(&b)
         | 
| 20 | 
            +
                      records = get.map do |data|
         | 
| 21 | 
            +
                        record = fire_record_class.to_instance(data)
         | 
| 22 | 
            +
                        b.call(record) if b
         | 
| 23 | 
            +
                        record
         | 
| 9 24 | 
             
                      end
         | 
| 25 | 
            +
                      b ? records : records.each
         | 
| 26 | 
            +
                    end
         | 
| 27 | 
            +
             | 
| 28 | 
            +
                    def inspect
         | 
| 29 | 
            +
                      entries = self.to_a.map(&:inspect)
         | 
| 30 | 
            +
                      "#<#{self.class.name} [#{entries.join(', ')}]>"
         | 
| 31 | 
            +
                    end
         | 
| 32 | 
            +
             | 
| 33 | 
            +
                    def pretty_print(q)
         | 
| 34 | 
            +
                      q.pp(self.to_a)
         | 
| 10 35 | 
             
                    end
         | 
| 11 36 |  | 
| 12 37 | 
             
                    def destroy_all
         | 
| 13 | 
            -
                      doc_refs =  | 
| 38 | 
            +
                      doc_refs = self.map(&:doc_ref)
         | 
| 14 39 | 
             
                      fire_record_class.delete_in_batch(doc_refs)
         | 
| 15 40 | 
             
                    end
         | 
| 16 41 |  | 
| 17 42 | 
             
                    def first(limit = 1)
         | 
| 18 | 
            -
                      records =  | 
| 43 | 
            +
                      records = limit(limit)
         | 
| 19 44 | 
             
                      limit == 1 ? records[0] : records
         | 
| 20 45 | 
             
                    end
         | 
| 21 46 |  | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: act_as_fire_record_beta
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.10
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Junichi Ito
         | 
| 8 8 | 
             
            autorequire:
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2022- | 
| 11 | 
            +
            date: 2022-12-28 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rails
         |