caboose-cms 0.4.128 → 0.4.129

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NWYxNmY0YjZjYTJkMzBlMGIzNjE0NWI1ZGJlMjU0Njg1M2FmZDc1NA==
4
+ NDAzMTMyODQzZjVkNzU4ZjZjZDZmOTVjNTBlZGQ1ZjQ1Yzg3NmZjZQ==
5
5
  data.tar.gz: !binary |-
6
- MzU3ODgzMjM1MjQwNDQ5NTBkZDY2MjlkOWNjNTVhMmVlNjhhMGNjYQ==
6
+ ZTE3YmViNWZlMDAzMWMwNTA1NDI5MmEyNzY0NWZiMzMzNTI2MWMzNQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MmJiZWExOTg4YjdjNWYyNzk3YjgwYTMyMzQ2YmRmMmIwYTBhYWNjYzg2Yjdi
10
- MTkzODE2MGMyM2Q2ZDk0ZjY1ZTE4NzIyNTQxZTQzNDhiN2I3M2VjMDVlZWIw
11
- YmM4MDk4ZDlhMzYxNWRiMDhjMGIzNGIzNzUzMWNhY2M3OGQ0YWQ=
9
+ ZDYxOTE0MGZiMzE2MTBiMDRiYTk1Yjc5MjAxY2Q3MWQyNjhmZjkwYTc4ZWI1
10
+ YzRkMmZhNTRjZWU3ZTY2ZTFlZjlmZTMwNDdjM2YxNTBiNTY0MjUzNDJlYmZi
11
+ MWIyOGQ1YWJjOTAyNzhjZmNmOGQ5ZmU0OWUyZTA3MDdjYWIyMTQ=
12
12
  data.tar.gz: !binary |-
13
- OTlkZWVlZjYyNTQ4ZWZjMWVmZDUzNmQxYjkwYWU5YjdlODkzZjJlMWE2M2Fm
14
- NjExMTBhM2RhNDRhNGY4MDlkMTZlZjljNzUwNWY1ZjU0MzUwYTk3ZTJiNTk4
15
- MTM5NzM2ZjMwYTkzMjc4ZDgzNmIzODdiMGJhZTcxNjFiYzQ5MmM=
13
+ NmNkOTA4ZTA4Njg3MDEyNGEzNDk3ZDVjZjcyMWU4MzEyZTlhOGZlZWQ3Y2Uz
14
+ OTJmZTA4NGQ1ZTM3YjMwMDkxOWY1NjAxNmZlNjNhYzNkYjVlYzMyNTZmYTk0
15
+ YWJmY2M3NzZmNDdjNTgxNTlmYjUxZjY0NDQwNTc1ZTA5MDhlZDY=
@@ -293,9 +293,9 @@ class Caboose::Page < ActiveRecord::Base
293
293
 
294
294
  path = []
295
295
  arr.each do |row|
296
- if (row.alias.length > 0)
296
+ if row.alias && row.alias.strip.length > 0
297
297
  path = [row.alias]
298
- elsif (row.slug.length > 0)
298
+ elsif row.slug && row.slug.strip.length > 0
299
299
  path << row.slug
300
300
  end
301
301
  end
@@ -312,6 +312,10 @@ class Caboose::Page < ActiveRecord::Base
312
312
  self.url_helper(p.parent_id, arr)
313
313
  end
314
314
 
315
+ def url
316
+ return Caboose::Page.url(self.id)
317
+ end
318
+
315
319
  def self.slug(str)
316
320
  return str.downcase.gsub(' ', '-').gsub(/[^\w-]/, '')
317
321
  end
@@ -348,5 +352,9 @@ class Caboose::Page < ActiveRecord::Base
348
352
  str << "#{self.title} | " if !self.title.nil? && self.title.strip.length > 0
349
353
  str << self.site.description if self.site && self.site.description
350
354
  end
355
+
356
+ def self.pages_with_tag(parent_id, tag)
357
+ self.includes(:page_tags).where(:hide => false, :parent_id => 1, :page_tags => { :tag => tag }).reorder('sort_order, title').all
358
+ end
351
359
 
352
360
  end
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.4.128'
2
+ VERSION = '0.4.129'
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.4.128
4
+ version: 0.4.129
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-10-03 00:00:00.000000000 Z
11
+ date: 2014-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails