form_obj 0.5.0 → 1.0.0
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 +5 -5
 - data/.gitignore +0 -4
 - data/CHANGELOG.md +43 -1
 - data/Gemfile.lock +2 -17
 - data/README.md +768 -213
 - data/Rakefile +1 -4
 - data/bundle_update.sh +27 -0
 - data/form_obj.gemspec +0 -1
 - data/lib/form_obj/form/array.rb +34 -10
 - data/lib/form_obj/form.rb +4 -0
 - data/lib/form_obj/model_mapper/array.rb +52 -33
 - data/lib/form_obj/model_mapper/attribute.rb +13 -2
 - data/lib/form_obj/model_mapper/model_attribute/item.rb +1 -0
 - data/lib/form_obj/model_mapper/model_attribute.rb +4 -3
 - data/lib/form_obj/model_mapper.rb +9 -1
 - data/lib/form_obj/struct/array.rb +35 -24
 - data/lib/form_obj/struct/attribute.rb +7 -3
 - data/lib/form_obj/struct.rb +16 -10
 - data/lib/form_obj/version.rb +1 -1
 - data/run_tests.sh +0 -1
 - metadata +4 -18
 - data/.rspec +0 -3
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 2 
     | 
    
         
            +
            SHA256:
         
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: a69ae52adaf40553cf429f30b569c3e9a4c86138178f65de08925948bdcf880a
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 7dc2e173d6e41f5b3b2626a1f6f99b82114cb94698f59fc7e1f89b9e3ce2042f
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: df60145ec27f618e2f30dfee8957c3047f67e781e80a733b3156ecdbccaa015f251fc7ebc500b4a71194019ced1e96dd416832e140d282d431f8405a44535623
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 022c08b6e40715ef8381e6266305a4f02362728d575faadda825dcefa10c22dd5f03b758657b20e026e4c3a130d84a5eb3296055d70cd129898fefd0c46c17f9
         
     | 
    
        data/.gitignore
    CHANGED
    
    
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -2,7 +2,49 @@ 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            ## [Unreleased](https://github.com/akoltun/form_obj/tree/HEAD)
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
       5 
     | 
    
         
            -
            [Full Changelog](https://github.com/akoltun/form_obj/compare/v0. 
     | 
| 
      
 5 
     | 
    
         
            +
            [Full Changelog](https://github.com/akoltun/form_obj/compare/v0.5.0...HEAD)
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            **Implemented enhancements:**
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            - Add parameters :read\_from\_model and :write\_to\_model [\#27](https://github.com/akoltun/form_obj/issues/27)
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            **Fixed bugs:**
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            - Create new FormObj::Form with \_destroy: true raises [\#43](https://github.com/akoltun/form_obj/issues/43)
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
            **Closed issues:**
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
            - Rewrite Reference Guide [\#59](https://github.com/akoltun/form_obj/issues/59)
         
     | 
| 
      
 18 
     | 
    
         
            +
            - Rearrange Table of Content [\#58](https://github.com/akoltun/form_obj/issues/58)
         
     | 
| 
      
 19 
     | 
    
         
            +
            - Redesign array.update\_attributes similar to array.sync\_to\_model\(s\) [\#47](https://github.com/akoltun/form_obj/issues/47)
         
     | 
| 
      
 20 
     | 
    
         
            +
            - Add example of custom ModelMapper.sync\_to\_model\(s\) [\#45](https://github.com/akoltun/form_obj/issues/45)
         
     | 
| 
      
 21 
     | 
    
         
            +
            - Add tests for method inspect  [\#44](https://github.com/akoltun/form_obj/issues/44)
         
     | 
| 
      
 22 
     | 
    
         
            +
            - Rewrite FormObj::ModelMapper tests in Minitest [\#36](https://github.com/akoltun/form_obj/issues/36)
         
     | 
| 
      
 23 
     | 
    
         
            +
            - Redesign deletion of arrayed form object in sync\_to\_model\(s\) [\#17](https://github.com/akoltun/form_obj/issues/17)
         
     | 
| 
      
 24 
     | 
    
         
            +
            - Overwritebility for :append, :update and :delete actions in :sync\_to\_model\(s\) for arrayed form objects [\#16](https://github.com/akoltun/form_obj/issues/16)
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
            **Merged pull requests:**
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
            - Prepare documentation for release [\#63](https://github.com/akoltun/form_obj/pull/63) ([akoltun](https://github.com/akoltun))
         
     | 
| 
      
 29 
     | 
    
         
            +
            - Add read from model and write to model [\#62](https://github.com/akoltun/form_obj/pull/62) ([akoltun](https://github.com/akoltun))
         
     | 
| 
      
 30 
     | 
    
         
            +
            - Correct load\_from\_model\(s\) tests [\#61](https://github.com/akoltun/form_obj/pull/61) ([akoltun](https://github.com/akoltun))
         
     | 
| 
      
 31 
     | 
    
         
            +
            - Rewrite reference guide [\#60](https://github.com/akoltun/form_obj/pull/60) ([akoltun](https://github.com/akoltun))
         
     | 
| 
      
 32 
     | 
    
         
            +
            - Customize sync to models [\#57](https://github.com/akoltun/form_obj/pull/57) ([akoltun](https://github.com/akoltun))
         
     | 
| 
      
 33 
     | 
    
         
            +
            - Refactor sync\_to\_models [\#56](https://github.com/akoltun/form_obj/pull/56) ([akoltun](https://github.com/akoltun))
         
     | 
| 
      
 34 
     | 
    
         
            +
            - Add class methods load\_from\_model\(s\) [\#55](https://github.com/akoltun/form_obj/pull/55) ([akoltun](https://github.com/akoltun))
         
     | 
| 
      
 35 
     | 
    
         
            +
            - Add load\_from\_model\(s\) as class methods [\#54](https://github.com/akoltun/form_obj/pull/54) ([akoltun](https://github.com/akoltun))
         
     | 
| 
      
 36 
     | 
    
         
            +
            - Correct documentation in README [\#53](https://github.com/akoltun/form_obj/pull/53) ([akoltun](https://github.com/akoltun))
         
     | 
| 
      
 37 
     | 
    
         
            +
            - Improve inspect method [\#52](https://github.com/akoltun/form_obj/pull/52) ([akoltun](https://github.com/akoltun))
         
     | 
| 
      
 38 
     | 
    
         
            +
            - Test that update\_attributes returns itself [\#51](https://github.com/akoltun/form_obj/pull/51) ([akoltun](https://github.com/akoltun))
         
     | 
| 
      
 39 
     | 
    
         
            +
            - Redesign update attributes [\#50](https://github.com/akoltun/form_obj/pull/50) ([akoltun](https://github.com/akoltun))
         
     | 
| 
      
 40 
     | 
    
         
            +
            - Add update non existent attribute tests [\#49](https://github.com/akoltun/form_obj/pull/49) ([akoltun](https://github.com/akoltun))
         
     | 
| 
      
 41 
     | 
    
         
            +
            - Fix wrong primary key test [\#48](https://github.com/akoltun/form_obj/pull/48) ([akoltun](https://github.com/akoltun))
         
     | 
| 
      
 42 
     | 
    
         
            +
            - Redesign sync arrays to model [\#46](https://github.com/akoltun/form_obj/pull/46) ([akoltun](https://github.com/akoltun))
         
     | 
| 
      
 43 
     | 
    
         
            +
            - Move tests from rspec to minitests and delete rspec [\#42](https://github.com/akoltun/form_obj/pull/42) ([akoltun](https://github.com/akoltun))
         
     | 
| 
      
 44 
     | 
    
         
            +
            - Small refactor [\#41](https://github.com/akoltun/form_obj/pull/41) ([akoltun](https://github.com/akoltun))
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
      
 46 
     | 
    
         
            +
            ## [v0.5.0](https://github.com/akoltun/form_obj/tree/v0.5.0) (2018-06-14)
         
     | 
| 
      
 47 
     | 
    
         
            +
            [Full Changelog](https://github.com/akoltun/form_obj/compare/v0.4.0...v0.5.0)
         
     | 
| 
       6 
48 
     | 
    
         | 
| 
       7 
49 
     | 
    
         
             
            **Implemented enhancements:**
         
     | 
| 
       8 
50 
     | 
    
         | 
    
        data/Gemfile.lock
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            PATH
         
     | 
| 
       2 
2 
     | 
    
         
             
              remote: .
         
     | 
| 
       3 
3 
     | 
    
         
             
              specs:
         
     | 
| 
       4 
     | 
    
         
            -
                form_obj (0. 
     | 
| 
      
 4 
     | 
    
         
            +
                form_obj (1.0.0)
         
     | 
| 
       5 
5 
     | 
    
         
             
                  activemodel (>= 3.2)
         
     | 
| 
       6 
6 
     | 
    
         
             
                  activesupport (>= 3.2)
         
     | 
| 
       7 
7 
     | 
    
         
             
                  typed_array (>= 1.0.2)
         
     | 
| 
         @@ -36,7 +36,6 @@ GEM 
     | 
|
| 
       36 
36 
     | 
    
         
             
                builder (3.2.3)
         
     | 
| 
       37 
37 
     | 
    
         
             
                concurrent-ruby (1.0.5)
         
     | 
| 
       38 
38 
     | 
    
         
             
                crass (1.0.4)
         
     | 
| 
       39 
     | 
    
         
            -
                diff-lcs (1.3)
         
     | 
| 
       40 
39 
     | 
    
         
             
                erubi (1.7.1)
         
     | 
| 
       41 
40 
     | 
    
         
             
                i18n (1.0.1)
         
     | 
| 
       42 
41 
     | 
    
         
             
                  concurrent-ruby (~> 1.0)
         
     | 
| 
         @@ -45,7 +44,7 @@ GEM 
     | 
|
| 
       45 
44 
     | 
    
         
             
                  nokogiri (>= 1.5.9)
         
     | 
| 
       46 
45 
     | 
    
         
             
                mini_portile2 (2.3.0)
         
     | 
| 
       47 
46 
     | 
    
         
             
                minitest (5.11.3)
         
     | 
| 
       48 
     | 
    
         
            -
                nokogiri (1.8. 
     | 
| 
      
 47 
     | 
    
         
            +
                nokogiri (1.8.4)
         
     | 
| 
       49 
48 
     | 
    
         
             
                  mini_portile2 (~> 2.3.0)
         
     | 
| 
       50 
49 
     | 
    
         
             
                rack (2.0.5)
         
     | 
| 
       51 
50 
     | 
    
         
             
                rack-test (1.0.0)
         
     | 
| 
         @@ -56,19 +55,6 @@ GEM 
     | 
|
| 
       56 
55 
     | 
    
         
             
                rails-html-sanitizer (1.0.4)
         
     | 
| 
       57 
56 
     | 
    
         
             
                  loofah (~> 2.2, >= 2.2.2)
         
     | 
| 
       58 
57 
     | 
    
         
             
                rake (10.5.0)
         
     | 
| 
       59 
     | 
    
         
            -
                rspec (3.7.0)
         
     | 
| 
       60 
     | 
    
         
            -
                  rspec-core (~> 3.7.0)
         
     | 
| 
       61 
     | 
    
         
            -
                  rspec-expectations (~> 3.7.0)
         
     | 
| 
       62 
     | 
    
         
            -
                  rspec-mocks (~> 3.7.0)
         
     | 
| 
       63 
     | 
    
         
            -
                rspec-core (3.7.1)
         
     | 
| 
       64 
     | 
    
         
            -
                  rspec-support (~> 3.7.0)
         
     | 
| 
       65 
     | 
    
         
            -
                rspec-expectations (3.7.0)
         
     | 
| 
       66 
     | 
    
         
            -
                  diff-lcs (>= 1.2.0, < 2.0)
         
     | 
| 
       67 
     | 
    
         
            -
                  rspec-support (~> 3.7.0)
         
     | 
| 
       68 
     | 
    
         
            -
                rspec-mocks (3.7.0)
         
     | 
| 
       69 
     | 
    
         
            -
                  diff-lcs (>= 1.2.0, < 2.0)
         
     | 
| 
       70 
     | 
    
         
            -
                  rspec-support (~> 3.7.0)
         
     | 
| 
       71 
     | 
    
         
            -
                rspec-support (3.7.1)
         
     | 
| 
       72 
58 
     | 
    
         
             
                thor (0.20.0)
         
     | 
| 
       73 
59 
     | 
    
         
             
                thread_safe (0.3.6)
         
     | 
| 
       74 
60 
     | 
    
         
             
                typed_array (1.0.2)
         
     | 
| 
         @@ -85,7 +71,6 @@ DEPENDENCIES 
     | 
|
| 
       85 
71 
     | 
    
         
             
              form_obj!
         
     | 
| 
       86 
72 
     | 
    
         
             
              minitest (~> 5.0)
         
     | 
| 
       87 
73 
     | 
    
         
             
              rake (~> 10.0)
         
     | 
| 
       88 
     | 
    
         
            -
              rspec (~> 3.0)
         
     | 
| 
       89 
74 
     | 
    
         | 
| 
       90 
75 
     | 
    
         
             
            BUNDLED WITH
         
     | 
| 
       91 
76 
     | 
    
         
             
               1.16.2
         
     |