conjoin 0.0.46 → 0.0.48

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7db404ddef236a4076b312cdbf2f358bea428628
4
- data.tar.gz: 9751c0af38677d7eb1585e8b301169f01f3cb296
3
+ metadata.gz: c0063b493a2df86c0ab6510f511acf420d2bdcf2
4
+ data.tar.gz: 669cee75a6f85aeccce2033686e242f9911c8fea
5
5
  SHA512:
6
- metadata.gz: 3bc89b371518d337498a207d37df54d2bd0512fcc75575bbd358bb734ef0ce75ac3d46d574d4b0cf8f6ed01145faf57bec3edf28b4849916aecd78a5d8dccfab
7
- data.tar.gz: 4083b993c0c3a6610f734f759268ed66fd3f71b9055806e11593c44f245b0f6706da0f4c3043d3fdf4e81d815a000f6444d0543c036c9d7630fe3cfdda585a09
6
+ metadata.gz: 7c82d119e1bf9dbea9050e29e06cf2b88991db278da5989937b4d8a6540135ac112111129e39e9a8cc53bb541e0f82d64e57898ea8d1e01ef8edaf6709405417
7
+ data.tar.gz: 8cd4ceb259a7d15dabe0f161f599c6cfb90159641dfa64e9f4209bfe4fdb6bcf7b18fa37294e1bbb1ea92a2e49c4b622f7d31a1be01ebd311fddd7e7f5354b80
@@ -67,10 +67,14 @@ module Conjoin
67
67
  def validate
68
68
  end
69
69
 
70
- def validates req_params
70
+ def validates req_params, opts = {}
71
71
  req_params = req_params.is_a?(OpenStruct) ? req_params.to_hash : HashIndifferent.new(req_params)
72
72
  @req_params = req_params
73
73
 
74
+ if as = opts.delete(:as)
75
+ add_creator_and_updater_for self, as, req_params
76
+ end
77
+
74
78
  run_callbacks :validates do
75
79
  self.attributes = req_params
76
80
  valid?
@@ -1,3 +1,3 @@
1
1
  module Conjoin
2
- VERSION = "0.0.46"
2
+ VERSION = "0.0.48"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conjoin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.46
4
+ version: 0.0.48
5
5
  platform: ruby
6
6
  authors:
7
7
  - cj