repositor 0.4.7 → 0.5.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 547d3129f9ad4900f0e05d29e326fc70a60ed3ed
4
- data.tar.gz: a669bd036a5a1309778c5a947630f1a9d215c2ff
3
+ metadata.gz: ea3d77e6eeb067afcc25a332a4015f9aca9d6d7b
4
+ data.tar.gz: 71763f7bc14e48b1f76ff63eb990dade3d3188a1
5
5
  SHA512:
6
- metadata.gz: 2aaf5c251141aab8efc0eb9481f00c1825b4577bd7edfcc23200e61a4097bb90c937e548734de4af20b4bcba52167627d2003442705f2fde8c34bd73610a2aa0
7
- data.tar.gz: c36c6842f118452d0a178d037142f54c87a0a015da143f09c764071e1618f38a5e2bf4b0c44b3a73f7e08af7fbe34e8b0ef27351eb6226279f3412ec84527dae
6
+ metadata.gz: 5bb4ee56e0366cc6e8aac6f3a7e61a7294e09c4319bd0647ce384882dfb0842fb81ec4a9cf63643bacd04eea91cc49ce90f871e5a811ced18e1c24ac63dcb13c
7
+ data.tar.gz: a4207c6188f7c453600014dc054ee1e5ad74c0ebf93a886745084f0e61ff7987973cddf997f046080f29346f64624a2624e78ace1f2742f0c3675f3222e24697
data/README.md CHANGED
@@ -86,6 +86,12 @@ end
86
86
  ## How to use
87
87
 
88
88
 
89
+ **By generator:**
90
+
91
+ `rails generate repos`
92
+
93
+ **Or manually:**
94
+
89
95
  In `app` directory you need to create new `repos` directory . Recomended to create `application_repo.rb` and inherit from it all repos, so you could keep all your repos under single point of inheritance.
90
96
 
91
97
  ```ruby
@@ -100,12 +106,16 @@ end
100
106
  Than you need to create `product_repo.rb`:
101
107
  ```ruby
102
108
  class ProductRepo < ApplicationRepo
103
- # here you will have default methods for repo actions
109
+ # here you have default methods for repository actions
104
110
  # if you want communicate with model class,
105
111
  # just can use model method to send it any method you need
106
112
  def all_with_name_john
107
113
  model.where(name: 'John')
108
114
  end
115
+
116
+ def create_if(params, condition)
117
+ create(params) if condition
118
+ end
109
119
  end
110
120
  ```
111
121
  and that's all... magic already happened (no)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: repositor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Volodya Sveredyuk