simple_options 0.0.1 → 0.0.2

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: 90de45199c46105af69c8bd70e5f9628baa91d1d
4
- data.tar.gz: 9bff5afc019362069394b8fd5fe811ad3b78ec76
3
+ metadata.gz: 2b76da1798f0c2b7ba3881507f9fbe5f3e72fb40
4
+ data.tar.gz: 0b5e35bf4737b8a8d81259d8c421a45cfd83f7ee
5
5
  SHA512:
6
- metadata.gz: 2dda5cf3d8a32a7cae424f9a7a2a2af9366a3b6e2733b8d757687c64552cef74e2699fa0deebfdc2c21141da2b9c97ecb2a3c5a503725c2dc287c4ba7005b840
7
- data.tar.gz: 7ec3a81c2bbf2e2cada6488500e2177ba5941f716c5066d1fc3ef95b58505fb72b8791b926a48c7edcf4d8585f01c6ffaad7e56a8a86288dcb8e9043bf9ae95e
6
+ metadata.gz: 99c0f67e7bfcf29df0afc509325cb8a7240fb616095e00726cba1a9dbcf36f709b3ca64182637c09303bf2ec0992a87b0854435329626f9f09536f2cc9291434
7
+ data.tar.gz: bf32fa2ce206a5698cf4ef532fa1f3133750fec263aa6d6427457dffacdfceee6c2a61ec6239c85d1364eb790aea78c5b842731534add03b13ffbc22f56e329b
@@ -0,0 +1,35 @@
1
+ require 'rails/generators'
2
+ require 'rails/generators/migration'
3
+ require 'rails/generators/active_record'
4
+
5
+
6
+ module SimpleOptions
7
+ module Generators
8
+ class InstallGenerator < ::Rails::Generators::Base
9
+ include Rails::Generators::Migration
10
+
11
+ desc "Install options"
12
+ source_root File.expand_path("../templates", __FILE__)
13
+
14
+
15
+ def self.next_migration_number(path)
16
+ unless @prev_migration_nr
17
+ @prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
18
+ else
19
+ @prev_migration_nr += 1
20
+ end
21
+ @prev_migration_nr.to_s
22
+ end
23
+
24
+ def self.next_migration_number(path)
25
+ #Time.now.utc.strftime("%Y%m%d%H%M%S")
26
+ ActiveRecord::Generators::Base.next_migration_number(path)
27
+ end
28
+
29
+ def create_migrations
30
+ migration_template 'migrations/create_options.rb', 'db/migrate/create_options.rb'
31
+ end
32
+
33
+ end
34
+ end
35
+ end
@@ -1,9 +1,9 @@
1
- class OptimacmsOptionsCreate < ActiveRecord::Migration
1
+ class CreateOptions < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :options do |t|
4
4
  t.string :name, :null => false
5
5
  t.string :title, :null => false
6
- t.string :title, :null => false
6
+ t.string :option_type, :null => false
7
7
  t.text :description, :null => true
8
8
  t.boolean :is_changed, :null => true, :default=>1
9
9
  t.string :category, :null => true
@@ -1,3 +1,3 @@
1
1
  module SimpleOptions
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_options
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Ivak
@@ -55,8 +55,8 @@ files:
55
55
  - app/models/option.rb
56
56
  - app/views/layouts/simple_options/application.html.erb
57
57
  - config/routes.rb
58
- - lib/generators/optimacms_options/install/install_generator.rb
59
- - lib/generators/optimacms_options/install/templates/migration.rb
58
+ - lib/generators/simple_options/install_generator.rb
59
+ - lib/generators/simple_options/templates/migrations/create_options.rb
60
60
  - lib/simple_options.rb
61
61
  - lib/simple_options/engine.rb
62
62
  - lib/simple_options/version.rb
@@ -1,28 +0,0 @@
1
- #require 'active_support/concern'
2
- require 'rails/generators/migration'
3
- #require 'rails/generators/actions/create_migration'
4
-
5
-
6
- module OptimacmsOptions
7
- module Generators
8
- class InstallGenerator < ::Rails::Generators::Base
9
- include Rails::Generators::Migration
10
- source_root File.expand_path('../templates', __FILE__)
11
- desc "add the migrations"
12
-
13
- def self.next_migration_number(path)
14
- unless @prev_migration_nr
15
- @prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
16
- else
17
- @prev_migration_nr += 1
18
- end
19
- @prev_migration_nr.to_s
20
- end
21
-
22
- def copy_migrations
23
- migration_template "migration.rb", "db/migrate/optimacms_options.rb"
24
- end
25
-
26
- end
27
- end
28
- end