rails_admin_state 1.0.0 → 1.0.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 +4 -4
- data/README.md +3 -1
- data/app/views/rails_admin/main/_form_state.html.haml +1 -0
- data/config/locales/en.rails_admin_state_machine.yml +0 -0
- data/config/locales/ru.rails_admin_state_machine.yml +0 -0
- data/lib/rails_admin_state/field.rb +6 -14
- data/lib/rails_admin_state/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4831cd161cd7681e10037116b42102da56ddcc56
|
4
|
+
data.tar.gz: cec1fc3f93131150827ab8e435ced5be24738877
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13c0343cbbde4c2ea08964da10294c7f3a663277990e19461ca1363e14d350f567cd497f11eaee32360468a0ba41fa50a6759c32d74a4eaea10108f760b943f9
|
7
|
+
data.tar.gz: 2a78bffd1aae26c53e342e72c1e23bf41ab327a7773350bfb479e20ae009074b0c721ba7b8531ce7ccb37b38904d467d787aa646ec4ce722887df738721220c1
|
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
#
|
1
|
+
# Rails Admin State Machine
|
2
|
+
### Properly manage state_machine states from rails_admin
|
2
3
|
|
3
4
|
Allows easily sending state_machine events to a model from Rails Admin, including support for
|
4
5
|
ActiveRecord \ Mongoid and custom state field name and multiple state machines per model.
|
@@ -66,6 +67,7 @@ Mark the field you need display as state:
|
|
66
67
|
Just as usual for state_machine, see:
|
67
68
|
|
68
69
|
http://rdoc.info/github/pluginaweek/state_machine/master/StateMachine/Integrations/Mongoid
|
70
|
+
|
69
71
|
http://rdoc.info/github/pluginaweek/state_machine/master/StateMachine/Integrations/ActiveRecord
|
70
72
|
|
71
73
|
For namespaced models use "/", just as usual: "Blog::Post" is "blog/post"
|
@@ -0,0 +1 @@
|
|
1
|
+
= field.pretty_value
|
File without changes
|
File without changes
|
@@ -9,18 +9,6 @@ module RailsAdmin
|
|
9
9
|
RailsAdmin::Config::Fields::Types::register(self)
|
10
10
|
include RailsAdmin::Engine.routes.url_helpers
|
11
11
|
|
12
|
-
register_instance_option :partial do
|
13
|
-
:form_enumeration
|
14
|
-
end
|
15
|
-
|
16
|
-
register_instance_option :enum do
|
17
|
-
enum = {}
|
18
|
-
bindings[:object].class.state_machines[name.to_sym].states.each do |state|
|
19
|
-
enum[state.human_name] = state.name.to_s
|
20
|
-
end
|
21
|
-
enum
|
22
|
-
end
|
23
|
-
|
24
12
|
register_instance_option :pretty_value do
|
25
13
|
@state_machine_options = ::RailsAdminState::Configuration.new @abstract_model
|
26
14
|
|
@@ -46,8 +34,12 @@ module RailsAdmin
|
|
46
34
|
('<div style="white-space: normal;">' + ret.join(' ') + '</div>').html_safe
|
47
35
|
end
|
48
36
|
|
49
|
-
register_instance_option :
|
50
|
-
|
37
|
+
register_instance_option :formatted_value do
|
38
|
+
pretty_value
|
39
|
+
end
|
40
|
+
|
41
|
+
register_instance_option :partial do
|
42
|
+
:form_state
|
51
43
|
end
|
52
44
|
|
53
45
|
register_instance_option :multiple? do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_admin_state
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- glebtv
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails_admin
|
@@ -66,6 +66,7 @@ files:
|
|
66
66
|
- LICENSE.txt
|
67
67
|
- README.md
|
68
68
|
- Rakefile
|
69
|
+
- app/views/rails_admin/main/_form_state.html.haml
|
69
70
|
- config/locales/en.rails_admin_state_machine.yml
|
70
71
|
- config/locales/ru.rails_admin_state_machine.yml
|
71
72
|
- lib/rails_admin_state.rb
|
@@ -96,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
97
|
version: '0'
|
97
98
|
requirements: []
|
98
99
|
rubyforge_project:
|
99
|
-
rubygems_version: 2.
|
100
|
+
rubygems_version: 2.1.10
|
100
101
|
signing_key:
|
101
102
|
specification_version: 4
|
102
103
|
summary: Manage model's state with state_machine and rails_admin
|