bootswatch_rails 3.2.0.9 → 3.2.0.10

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5c29af7c2c41bffd6146e9fd4e726aa6202cc830
4
- data.tar.gz: dae74081c4ff90d6fe2248ed5451f13864830724
3
+ metadata.gz: 60232bc73b47d3b4656dd3498d9bdcdf5bbb9fa6
4
+ data.tar.gz: df80d969c88617677b7f5cb07ebfca77e11ca21c
5
5
  SHA512:
6
- metadata.gz: 3f2f02a86545e79db91a55b1d00c5ea9f183becdefe5753dedeecb5f12bccf5556991c176a2e00c3c1943e332aebc95a5b4c3563bcacd3c0b74be1349e0ec35c
7
- data.tar.gz: 3af828a7d06e3325db033bc46841c054ff03dc21aba31c363b90a5c9a514db03eeca390a30f7e4e9c079a02157115d1b6f468d3a61cc23da794f7f77ef3fd68d
6
+ metadata.gz: 90a3a2da7c4633b33988d8f389333b6c43fa7e0bb5d0376e215317ff784d25ba83b998f4031766a63b8d410536696bae0ff0c227be209c2b21f066000293ce33
7
+ data.tar.gz: 6b90ff94b904769f85eaab1a291f9ef5144b0f84466dae57091ecfed90908b76380d0b1ac0513a81d6141d620b382a36a305f36ab0c9a497b9838a15950ca271
@@ -1,5 +1,5 @@
1
1
  module BootswatchRails
2
- VERSION = "3.2.0.9"
2
+ VERSION = "3.2.0.10"
3
3
  THEMES = [:amelia, :cerulean, :cosmo, :custom, :cyborg, :darkly, :flatly, :journal, :lumen, :paper, :readable, :sandstone, :simplex, :slate, :spacelab, :superhero, :united, :yeti]
4
4
  DEFAULT = 1
5
5
  end
@@ -8,7 +8,7 @@ module BootswatchRails
8
8
  desc: "The resource to be updated"
9
9
  argument :user, type: :string, default: "user",
10
10
  banner: "user model (default 'user')"
11
- class_option :migration, type: :boolean, default: true,
11
+ class_option :migration, type: :boolean, default: false,
12
12
  desc: 'Create a migration for added attributes'
13
13
  source_root File.expand_path('../templates', __FILE__)
14
14
 
@@ -23,19 +23,20 @@ module BootswatchRails
23
23
 
24
24
  def update_controller
25
25
  file = "app/controllers/#{table_name}_controller.rb"
26
+ curr = "current_#{user}"
26
27
  inject_into_file file, after: /def update$/ do
27
- "\n @#{name}.updated_by = current_#{user}.id if current_#{user}"
28
+ "\n @#{name}.updated_by = #{curr} ? #{curr}.id : nil"
28
29
  end
29
30
  inject_into_file file, after: /@#{name} = #{class_name}\.new\(#{name}_params\)$/ do
30
- "\n @#{name}.created_by = current_#{user}.id if current_#{user}" +
31
- "\n @#{name}.updated_by = current_#{user}.id if current_#{user}"
31
+ "\n @#{name}.created_by = #{curr} ? #{curr}.id : nil" +
32
+ "\n @#{name}.updated_by = #{curr} ? #{curr}.id : nil"
32
33
  end
33
34
  end
34
35
 
35
36
  protected
36
37
 
37
38
  def migration_name
38
- "add_created_by_to_#{name}"
39
+ "add_created_by_to_#{table_name}"
39
40
  end
40
41
  end
41
42
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootswatch_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0.9
4
+ version: 3.2.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Volker Wiegand