simple_admin 0.3.0 → 0.3.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.
@@ -2,6 +2,7 @@ module SimpleAdmin
2
2
  module FilterHelper
3
3
  def filter_for(method, klass, options={})
4
4
  options ||= {}
5
+ options = options.dup
5
6
  options[:as] ||= default_filter_type(klass, method)
6
7
  return "" unless options[:as]
7
8
  field_type = options.delete(:as)
data/lib/simple_admin.rb CHANGED
@@ -78,9 +78,11 @@ module SimpleAdmin
78
78
  #
79
79
  # Various configuration options are available within the block
80
80
  def register(resource, options={}, &block)
81
- interface = SimpleAdmin::Interface.new(resource, options, &block)
82
- self.registered << interface
83
- interface
81
+ if defined?(@@registered)
82
+ interface = SimpleAdmin::Interface.new(resource, options, &block)
83
+ self.registered << interface
84
+ interface
85
+ end
84
86
  end
85
87
  end
86
88
 
@@ -17,6 +17,7 @@ module SimpleAdmin
17
17
  @section = section
18
18
  defaults(options)
19
19
  instance_eval(&block) if block_given?
20
+ self
20
21
  end
21
22
 
22
23
  # Clear the attributes for this section
@@ -10,6 +10,7 @@ module SimpleAdmin
10
10
  attributes
11
11
  filters if @allow_filters
12
12
  instance_eval(&block) if block_given?
13
+ self
13
14
  end
14
15
 
15
16
  def attributes(attr_options={}, &block)
@@ -1,3 +1,3 @@
1
1
  module SimpleAdmin
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_admin
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 0
10
- version: 0.3.0
9
+ - 1
10
+ version: 0.3.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jeff Rafter
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-06-27 00:00:00 -07:00
18
+ date: 2011-06-29 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency