caboose-cms 0.3.37 → 0.3.38

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YmRkZTI2OGFjZWYwOTJiNjU1ODM3ODAwYjc4ZGRhYzQ3NThjMTBlYw==
4
+ YzQzMjk4MzMxNmNiMmQ4ZmI5NjRlN2Q1Yjk4OThkZGNmZDgwMjhlOQ==
5
5
  data.tar.gz: !binary |-
6
- YmZmMWJhMzg1Y2Y5OTFmZTUxZjhhYmY3MWViZjhiNjY3ZDliMDQ1NA==
6
+ NGJiN2M3MzA2ZTBjOTk4NjYxNzg1M2U3NDllZGY3Yzg1ZDU0ZTQ0MA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZGQ4ZTViNGJjMzQ2MTM1MWY5ZTRiOTlkMTUzZmFjYjA3ZjEyZjI1MzAxZGE1
10
- NTk5MTkzYmE3N2YyNGExNTgxMWE2YTVjZTFhOWI1ZGY0MDRhNzFlNDAwMjIz
11
- NWJlYjg0MzBlMGRhM2Y4MTA5MWU4MjUxZjM5OWVjZmM3ZmNiNjc=
9
+ MDc3NzA2OGMyODljMmEyYjhkOWU2OGZmNjk4Y2JmNmJkMzZmMDIxMTQ1NGQ4
10
+ ZTJjOWJmNGU1NDgyZWFhMjQ0YTdmM2IzYzU4NmQ4OWE5NDAwZTg3Mzc1YmZh
11
+ MDIyZjkxYjM2ZDMxZDdlNWNmODFhNmFlY2I3OGIwMWFhYTU2MTI=
12
12
  data.tar.gz: !binary |-
13
- OTVlMzQ2ZGE1OWNiYzNkZjdkNjBmMDk4ODAxOGI0N2IwYWNiNDJhZTQzZDg1
14
- ZWEwMjgxYmE5NWZlOTFjMTIzMGU5YjNmOTI5NTE2OTg5MjIyNjVjMDU1OGMz
15
- MjAyNWU0NzZkZWEwMjg0ZDcwZDQ5YWVmODdhMzRkNjk0ODVmNDA=
13
+ MDI2Y2MyZmYxYzRkNjQzMTU5MGRjYjhhN2IzZjZiZTlmYzg4OGMwOWU0ZTMz
14
+ YmJlMTgxZjkyMDU0ODM1MTM3OGQxZmIwNmRjZDIyYjczNmQ2NjY2ZWI0ZjQ1
15
+ ZGZlY2EyMWIyYzU1OWIxNTRiZGE4NzRjNzcxODVlZDI2N2RjODg=
@@ -3,7 +3,7 @@ var CabooseModal = function(w, h) {
3
3
  if (!h)
4
4
  {
5
5
  $('#modal_content').css('width', w);
6
- h = $('#modal_content').outerHeight(true);
6
+ h = $('#modal_content').outerHeight(true);
7
7
  }
8
8
  if (parent.$.fn.colorbox)
9
9
  this.resize(w, h);
@@ -27,7 +27,7 @@ CabooseModal.prototype = {
27
27
 
28
28
  colorbox: function() {
29
29
  if (parent && parent.$.fn.colorbox)
30
- {
30
+ {
31
31
  parent.$.fn.colorbox.resize({
32
32
  innerWidth: '' + this.width + 'px',
33
33
  innerHeight: '' + this.height + 'px'
@@ -69,10 +69,20 @@ module Caboose
69
69
  return m if @options['includes'].nil?
70
70
 
71
71
  associations = []
72
- @options['includes'].each do |field, arr|
73
- next if @params[field].nil? || (@params[field].kind_of?(String) && @params[field].length == 0)
72
+ @options['includes'].each do |field, arr|
73
+ next if @params[field].nil? || (@params[field].kind_of?(String) && @params[field].length == 0)
74
74
  associations << arr[0]
75
- end
75
+ end
76
+ if @options['sort']
77
+ @options['sort'].split(',').each do |col|
78
+ tbl_col = col.split('.')
79
+ if tbl_col && tbl_col.count > 1
80
+ @options['includes'].each do |field, arr|
81
+ associations << arr[0] if table_name_of_association(arr[0]) == tbl_col[0]
82
+ end
83
+ end
84
+ end
85
+ end
76
86
  associations.uniq.each { |assoc| m = m.includes(assoc) }
77
87
  return m
78
88
  end
@@ -190,8 +200,9 @@ module Caboose
190
200
  if !@custom_url_vars.nil?
191
201
  return @custom_url_vars.call @options['base_url'], @params
192
202
  end
203
+
193
204
  vars = []
194
- @params.each do |k,v|
205
+ @params.each do |k,v|
195
206
  next if @options['skip'].include?(k)
196
207
  k = @options['abbreviations'].include?(k) ? @options['abbreviations'][k] : k
197
208
  if v.kind_of?(Array)
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.3.37'
2
+ VERSION = '0.3.38'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.37
4
+ version: 0.3.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-16 00:00:00.000000000 Z
11
+ date: 2014-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails