metric_admin 0.0.14 → 0.0.15

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.
data/README.md CHANGED
@@ -135,6 +135,19 @@ Also ensure that you have linked in the admin layout the lastest jquery.ui.min.j
135
135
 
136
136
  Ensure that the metric table has a public_sort column.
137
137
 
138
+ In the dashboard application modify ```app/models/metric.rb```
139
+
140
+ attr_accessible :title, :name, :description, :logic, :status, :sort, :resource_type_id, :has_detail, :data_type, :metric_summaries_attributes
141
+
142
+ has_many :metric_summaries
143
+ accepts_nested_attributes_for :metric_summaries, :allow_destroy => true, :reject_if => lambda { |a| a[:title].blank? }
144
+
145
+ In ```config/routes.rb```
146
+
147
+ admin.resources :metrics, :controller => 'metrics' do |m|
148
+ m.resources :metric_summaries
149
+ end
150
+
138
151
  ## Contributing
139
152
 
140
153
  1. Fork it ( https://github.com/analyticsforlawyers/afl_teamwork/fork )
@@ -3,14 +3,14 @@
3
3
  = ms.label "Metric summary title"
4
4
  = ms.text_field :title
5
5
  = ms.label "Group by"
6
- = ms.select :group_by_key, eval(@metric.logic.match(/\['(.*?)'\]/)[0])
6
+ = ms.select :group_by_key, eval(@metric.logic.match(/\['(.*?)'\]/)[0]), :prompt => 'select one...'
7
7
  and
8
8
  = ms.label "Action"
9
- = ms.select :action, %w(count sum average median), {}, :class => "action-to-take"
9
+ = ms.select :action, %w( count sum average median), {}, { :class => "action-to-take" }
10
10
  on
11
11
  %div.acton
12
12
  = ms.label "Act on"
13
- = ms.select :action_on, eval(@metric.logic.match(/\['(.*?)'\]/)[0])
13
+ = ms.select :action_on, eval(@metric.logic.match(/\['(.*?)'\]/)[0]), :include_blank => true
14
14
  = link_to "Add summary", "#", :class => "add_fields", :'data-id' => @metric.id
15
15
  - if ms.object.new_record?
16
16
  = link_to "Remove", "#", :class => "remove_fields"
@@ -1,3 +1,3 @@
1
1
  module MetricAdmin
2
- VERSION = "0.0.14"
2
+ VERSION = "0.0.15"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 14
9
- version: 0.0.14
8
+ - 15
9
+ version: 0.0.15
10
10
  platform: ruby
11
11
  authors:
12
12
  - Analytics For Lawyers
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2016-09-29 00:00:00 -04:00
17
+ date: 2016-09-30 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency