databound 2.0.0 → 2.0.1

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: 5ce2e285adc96c5f0b13cbd9cd589b9dadce846f
4
- data.tar.gz: 6fab1b5aa84e5117d46f0a9814b22a16da8137f1
3
+ metadata.gz: cba727e2ab9d8e8ae6f7493aad47e28cac352592
4
+ data.tar.gz: d6791304413633e2abdaee1b737a77b1a9dfaea3
5
5
  SHA512:
6
- metadata.gz: 0a5ea8a940a8a532e8be042e8b8ce8bed21671dea38982e7487e1176def567787e6f9fa0015ba33e55f28c0001f11e5d92ae90e8d7e505b4bb8da35ad1d2b786
7
- data.tar.gz: c2a0d1ff9b404a105b4c14090acc239fb46078d5313a18bd0f54049280f8df377e9de7622011b94e8a0870ca6c9bbbc481d02514aba1465cc25920a405edab62
6
+ metadata.gz: 63143f0d64ad79f6563425cd35b7a73a4e01d0c3b40b369476c34f77c52d54c64a2793f57b68f39970c8031f6706df4fdb038aacfd29ff3fbccc58cb6f0d008a
7
+ data.tar.gz: b6cdeca9c47ab71d89368ed45f2c10ee2f3eb715f693b3255264083982d25d9415c9fe1ee3723ae4ef947a5fb1ca81ab0cc682314d7c0ad4d953deb8c15e60e0
@@ -84,7 +84,7 @@ module Databound
84
84
  when :table_columns
85
85
  table_columns
86
86
  else
87
- columns
87
+ Array(columns)
88
88
  end
89
89
  end
90
90
 
@@ -2,14 +2,18 @@ module Databound
2
2
  class Utils
3
3
  def self.create_controller_unless_exists(path, resource, opts)
4
4
  return if exists?(path)
5
+ opts ||= {}
5
6
 
6
7
  controller = Class.new(ApplicationController)
7
8
  controller.send(:include, Databound)
8
9
  controller.send(:define_method, :model) do
9
10
  resource.to_s.classify.constantize
10
11
  end
12
+
11
13
  controller.send(:define_method, :permitted_columns) do
12
- opts[:permitted_columns]
14
+ opts.fetch(:permitted_columns) do
15
+ raise 'Specify permitted_columns in routes or the controller'
16
+ end
13
17
  end
14
18
 
15
19
  Object.const_set(controller_name(path), controller)
@@ -1,3 +1,3 @@
1
1
  module Databound
2
- VERSION = '2.0.0'
2
+ VERSION = '2.0.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: databound
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Domas Bitvinskas