guts 1.3.5 → 1.3.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b7b4c7de67e67a75f5f5426d6b239163120d8e9e
4
- data.tar.gz: 6e385290b8d461987e65f287d4cfa358f9dde625
3
+ metadata.gz: 43a804bb1b0e10df20411d3be89d6ac3d313b10a
4
+ data.tar.gz: 5b29faed67dfed3d49148a6af0d003c3db014906
5
5
  SHA512:
6
- metadata.gz: a5cb35511239bd243e9ee8b900a1bb854692bb004dd701adfad09f8d94941297968f80104558128246820c905f498b59dd9af013977db65f0eec681c96a54bee
7
- data.tar.gz: 44cf2b8af0889687c6746cb6347ed37fdf71b4f1f862180c2ca85e4dc301ebc2ef4950c78c794c040b9f7237b9868f00c39a1b8683f8db88a36a0eb8f05e7da0
6
+ metadata.gz: 00406b4fffa6a01b200c585c2cbe70eeb770995f05360ecf9cffb8343f3f19fbf5bb502fe5306b57ea72af891413169181ad29237d64d924601ce721f1fdfd36
7
+ data.tar.gz: c20fc0c304498b76773d234b64ec82cfa2596995dfd9cd6309bd17bf90627f77ad34564d0ea2a413a88e4e789ac4a93a9eb3e3e108e11f1c76968a86603066ce
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # Version 1.3.6
2
+
3
+ + Added methods to models for friendly_id so the slugs will update on title change.. previously, slugs would not update
4
+ + Slug fields on all forms now are `readonly` and `disabled`
5
+
1
6
  # Version 1.3.5
2
7
 
3
8
  + Added ENV var for TravisCI to surpress unneeded Ruby warnings
@@ -18,5 +18,11 @@ module Guts
18
18
  friendly_id :title, use: [:slugged, :scoped, :finders], scope: :site_id
19
19
  navigatable :title, format: ':title'
20
20
  trackable :create, :update, :destroy, fields: [:title, :slug]
21
+
22
+ # Updates slug if title changes
23
+ # @return [Boolean]
24
+ def should_generate_new_friendly_id?
25
+ title_changed?
26
+ end
21
27
  end
22
28
  end
@@ -21,5 +21,11 @@ module Guts
21
21
  friendly_id :title, use: [:slugged, :scoped, :finders], scope: :site_id
22
22
  navigatable :'type.title', :title, format: '[:type.title] :title'
23
23
  trackable :create, :update, :destroy, fields: [:title, :visible, :tags, :slug]
24
+
25
+ # Updates slug if title changes
26
+ # @return [Boolean]
27
+ def should_generate_new_friendly_id?
28
+ title_changed?
29
+ end
24
30
  end
25
31
  end
@@ -3,16 +3,22 @@ module Guts
3
3
  class Group < ActiveRecord::Base
4
4
  extend FriendlyId
5
5
  include TrackableConcern
6
-
6
+
7
7
  validates :title, presence: true, length: { minimum: 3 }
8
-
8
+
9
9
  has_many :user_groups
10
10
  has_many :users, through: :user_groups
11
11
  has_many :media, as: :filable, dependent: :destroy
12
12
  has_many :metafields, as: :fieldable, dependent: :destroy
13
13
  has_many :tracks, as: :object
14
-
14
+
15
15
  friendly_id :title, use: [:slugged, :finders]
16
16
  trackable :create, :update, :destroy, fields: [:title]
17
+
18
+ # Updates slug if title changes
19
+ # @return [Boolean]
20
+ def should_generate_new_friendly_id?
21
+ title_changed?
22
+ end
17
23
  end
18
24
  end
@@ -15,5 +15,11 @@ module Guts
15
15
 
16
16
  friendly_id :title, use: [:slugged, :scoped, :finders], scope: :site_id
17
17
  trackable :create, :update, :destroy, fields: [:title]
18
+
19
+ # Updates slug if title changes
20
+ # @return [Boolean]
21
+ def should_generate_new_friendly_id?
22
+ title_changed?
23
+ end
18
24
  end
19
25
  end
@@ -16,5 +16,11 @@ module Guts
16
16
  friendly_id :title, use: [:slugged, :scoped, :finders], scope: :site_id
17
17
  navigatable :title, format: ':title'
18
18
  trackable :create, :update, :destroy, fields: [:title]
19
+
20
+ # Updates slug if title changes
21
+ # @return [Boolean]
22
+ def should_generate_new_friendly_id?
23
+ title_changed?
24
+ end
19
25
  end
20
26
  end
@@ -38,7 +38,7 @@
38
38
  <% unless @category.new_record? %>
39
39
  <div class="small-12 columns">
40
40
  <%= f.label :slug %>
41
- <%= f.text_field :slug %>
41
+ <%= f.text_field :slug, readonly: true, disabled: true %>
42
42
  </div>
43
43
  <% end %>
44
44
  <% end %>
@@ -39,7 +39,7 @@
39
39
  <% unless @content.new_record? %>
40
40
  <div class="small-12 columns">
41
41
  <%= f.label :slug %>
42
- <%= f.text_field :slug %>
42
+ <%= f.text_field :slug, readonly: true, disabled: true %>
43
43
  </div>
44
44
  <% end %>
45
45
 
@@ -39,7 +39,7 @@
39
39
  <% unless @group.new_record? %>
40
40
  <div class="small-12 columns">
41
41
  <%= f.label :slug %>
42
- <%= f.text_field :slug %>
42
+ <%= f.text_field :slug, readonly: true, disabled: true %>
43
43
  </div>
44
44
  <% end %>
45
45
  <% end %>
@@ -30,7 +30,7 @@
30
30
  <% unless @navigation.new_record? %>
31
31
  <div class="small-12 columns">
32
32
  <%= f.label :slug %>
33
- <%= f.text_field :slug %>
33
+ <%= f.text_field :slug, readonly: true, disabled: true %>
34
34
  </div>
35
35
  <% end %>
36
36
 
@@ -39,7 +39,7 @@
39
39
  <% unless @type.new_record? %>
40
40
  <div class="small-12 columns">
41
41
  <%= f.label :slug %>
42
- <%= f.text_field :slug %>
42
+ <%= f.text_field :slug, readonly: true, disabled: true %>
43
43
  </div>
44
44
  <% end %>
45
45
 
data/lib/guts/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # Guts' module namespace
2
2
  module Guts
3
3
  # Current Guts version
4
- VERSION = '1.3.5'.freeze
4
+ VERSION = '1.3.6'.freeze
5
5
  end
Binary file
Binary file