bizness 0.1.0 → 0.1.1

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: 46ccf06a38a9105276d39ba1cda08326a8297313
4
- data.tar.gz: 1b04f4e1195cf2cd40acc7521deef036c06ddd67
3
+ metadata.gz: 52657da3321f8216c3aed22df7aa598b0ddce78d
4
+ data.tar.gz: 351634c989bf984d60e09d97f625b12176f2c5e9
5
5
  SHA512:
6
- metadata.gz: cd74a12a843d17aeca92f51f82928ffcbad4b143af83df5720801f7fa7a925a58f3ca049673758d05ecd49c34103fa301ef5d4c1c99256de27d021e2e30caca0
7
- data.tar.gz: 6045251f26b029b4b1b19e311d4543b1a34c9bc9ad0d314181c2e5cc800b504052ae104da585a717806caf36769034a1b5d14c3195ac7046b3535785cc8da396
6
+ metadata.gz: 944b4590e34e31ce2d4c127ed3e05e95712327b4077e2aa004e0c38566c3399b4ab8d154178e541ffab617c7b0cce242f31111ae7d720c92cca7442bbc2bc980
7
+ data.tar.gz: 3e8b318b87f9243688fa97bde6d296fd5187184c5ce18d79974fe0f750924c6575123782bd37a95dfa24299d43e5bda45db0c67e8bda3dc569280511e82e90a7
@@ -6,4 +6,13 @@ class Bizness::Context < OpenStruct
6
6
  def successful?
7
7
  error.nil?
8
8
  end
9
+
10
+ # If a value responds to #id, automatically set an equivalent "_id" key/value pair. For example, if an instance
11
+ # of an ActiveRecord class Widget is set on a context object of :widget, set another attribute called :widget_id with
12
+ # the value of the object's ID. This helps ensure the context's values can be sent as a message across application
13
+ # boundries.
14
+ def to_h
15
+ super.each { |k, v| send("#{k}_id=", v.id) if v.respond_to?(:id) && send("#{k}_id").nil? }
16
+ super
17
+ end
9
18
  end
@@ -6,7 +6,7 @@ class Bizness::Operation
6
6
  attr_reader :context
7
7
 
8
8
  def initialize(context = {})
9
- @context = context.is_a?(Bizness::Context) ? context : Bizness::Context.new(context)
9
+ @context = Bizness::Context.new(context.to_h)
10
10
  end
11
11
 
12
12
  def self.filters
@@ -1,3 +1,3 @@
1
1
  module Bizness
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bizness
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ShippingEasy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-08-07 00:00:00.000000000 Z
11
+ date: 2015-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -141,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
141
  version: '0'
142
142
  requirements: []
143
143
  rubyforge_project:
144
- rubygems_version: 2.2.2
144
+ rubygems_version: 2.4.8
145
145
  signing_key:
146
146
  specification_version: 4
147
147
  summary: Get your bizness right and organize your business logic into operations.