aptible-rails 0.4.8 → 0.4.9

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: 1ece6e2f911c1e03005cc1bd43d1b5f6c0e21d55
4
- data.tar.gz: 4441f55fa97a7956bd92db9f6ba78e22f2421235
3
+ metadata.gz: 3d401509e9551ecfd52e6baa1459cdeb229d76c0
4
+ data.tar.gz: 364a1ee40a484f5ecf76e7868749cda18c5084e0
5
5
  SHA512:
6
- metadata.gz: b3a7127c92c367ab7ef6e30a30c2ebe0494c50aefff4a8830ff0106489c8dd06eb76f949f2ebc1ea79c12268be1ead44d64b55300e27b650ff20417af59425cf
7
- data.tar.gz: 84b07acb20990640840dcbfe4dcaac9035972d91331b4068b1865b1316d72ad8826a53dffbda257380e9369dde267405ab6fca8ab8dfc04bba299a15bd987d64
6
+ metadata.gz: a9b78056d573b376d41d7520622cc963ca149c9d880097724c797f41ac6604717cfba32301780ea76afee62a0b7122f6adca2f01d47b55a44b1102cbe0a1f2e7
7
+ data.tar.gz: b282da1e58ef2ebaac4aebc767b452781353d642fe69429e0a4c31ea641630f6a0b041b1261561c17a6f523e7382346f9b853b3632c3179d53fbe64c433f2154
@@ -1,8 +1,10 @@
1
1
  module Aptible
2
2
  module Rails
3
3
  module ArrayExtensions
4
- def decorate
5
- map(&:decorate)
4
+ def decorate(options = {})
5
+ map do |object|
6
+ object.decorate(options)
7
+ end
6
8
  end
7
9
  end
8
10
  end
@@ -4,6 +4,10 @@ class ApplicationDecorator < Draper::Decorator
4
4
  include Garner::Cache::Context
5
5
 
6
6
  delegate_all
7
+
8
+ def pretty_errors
9
+ "Some fields had errors: #{object.errors.full_messages.join(', ')}."
10
+ end
7
11
  end
8
12
 
9
13
  require_relative 'resource_decorator'
@@ -1,9 +1,9 @@
1
1
  module Aptible
2
2
  module Rails
3
3
  module DraperExtensions
4
- def decorate
4
+ def decorate(options = {})
5
5
  klass = self.class.name.split('::').last
6
- "#{klass}Decorator".constantize.decorate(self)
6
+ "#{klass}Decorator".constantize.decorate(self, options)
7
7
  end
8
8
  end
9
9
  end
@@ -1,5 +1,5 @@
1
1
  module Aptible
2
2
  module Rails
3
- VERSION = '0.4.8'
3
+ VERSION = '0.4.9'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aptible-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.8
4
+ version: 0.4.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frank Macreery