model_view 0.1.2 → 0.1.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
  SHA1:
3
- metadata.gz: 71429c06ee7aa9db651f524b4c91ad9c339ae689
4
- data.tar.gz: f44a76b5e2fe0847f6ea86da4729278fa9296b14
3
+ metadata.gz: aef140793172f7e2692c3fb46cf86a5d9ee94acb
4
+ data.tar.gz: fbd1d07a10c07fd055db7e126d05112902b80d85
5
5
  SHA512:
6
- metadata.gz: '01014719b0d56562ff129f4dd5f1a8eb2f54210b46bd365b89abf4e8ff0360035edbcb3a00fc6515aa222b061ee1f57259c1fce34c8cbd5d215669bf98f718ed'
7
- data.tar.gz: 76f2f35fc561f8afaa2195f79f1257df20c1c68d4f2d7d9d861b0a8cc72e39985bfae54d4ac77cdcb34883818e720ddd9d7584973e1aba488c94b2d75b028c78
6
+ metadata.gz: d1eba489732401a4448576c68a076ab27a1af43b623108a65fec0056c2c4c6689823595027cce93f55e652427a5eb64db583d1c77a06d3362aa96dfa418a65d9
7
+ data.tar.gz: bb8f406b8de03109e1e93061776097b69bac01f6451cf6bd977979e22044420b0c6923ceb58ff4ee1d5d853018511e1ab26eb6b3531d0b14e59c2ae911139ac9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ # 0.1.3
4
+ * Readme fixes
5
+
6
+
3
7
  # 0.1.2
4
8
  * Cleaned up ModelView.as_hash arguments
5
9
  * Update readme
data/README.md CHANGED
@@ -6,7 +6,7 @@ ModelView let's you define views for your models in one place.
6
6
  ### Why ModelView?
7
7
 
8
8
  At OfferZen, most of our rails models can be presented in al least two ways. For example, an Interview Request
9
- is presented differently to a candidate than to a company. But, there is also a lot of fields that get presented
9
+ is presented differently to a candidate than to a company. But, there are also a lot of fields that get presented
10
10
  the same to both candidates and companies. We found ourselves duplicating a lot of our serialisation code in our
11
11
  controllers and the code started to get out of hand.
12
12
 
@@ -14,7 +14,7 @@ ModelView works with Rails, but Rails is definitely not a requirement
14
14
 
15
15
  ### How to use ModelView
16
16
 
17
- 1) Include the yem in your gemfile
17
+ 1) Include the gem in your gemfile
18
18
  ```ruby
19
19
  gem "model_view", '~> 0.1'
20
20
  ```
@@ -33,8 +33,8 @@ field :name
33
33
 
34
34
  field(:first_name) { |person| person.name.split(' ').first }
35
35
 
36
- field :is_current_user, context[:current_user] do |person|
37
- person.name.split(' ').first
36
+ field :is_current_user, context[:current_user] do |person, current_user|
37
+ person == current_user
38
38
  end
39
39
  ```
40
40
  4) Let ModelView serialise an instance
@@ -64,8 +64,8 @@ scope :demographics do
64
64
  end
65
65
 
66
66
  scope :status do
67
- field :is_current_user, context[:current_user] do |person|
68
- person.name.split(' ').first
67
+ field :is_current_user, context[:current_user] do |person, current_user|
68
+ person == current_user
69
69
  end
70
70
  end
71
71
 
@@ -1,3 +1,3 @@
1
1
  module ModelView
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: model_view
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Pretorius