rails_options 0.1.2 → 0.1.5

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
  SHA256:
3
- metadata.gz: 76685c314fab5ac50127bd51dda9dcebcd34604ff46de8e52d638e8daefb3c29
4
- data.tar.gz: 4ed78e8e4979cd8219a64a78416bd01b18178de9bbdf84fac2f7becd6e4b4066
3
+ metadata.gz: 26017194b09b982f3a18f04ffe7803cd357d8f33b2267bcd7f10018c3cc3e56b
4
+ data.tar.gz: a63efba234ef02faeadd27b93ad3048edb4a7836944a089329e3513aa110de29
5
5
  SHA512:
6
- metadata.gz: 6d90ef1fce3ff9d33a67f6526269b533cc431b909f80600561498769cfb9b3b2a8845a93e59768e87248723c5c0bbf64cbe3df5f08b4201110ca12f91c8a0cce
7
- data.tar.gz: 840682f245951ed10cabbdfaa6bd66eaa7ee92a6d385c5a1ba020108df0dda9aae265988d77bd77d0437ef637804fff571c3d9d6def837855b3aec0aa849f6ba
6
+ metadata.gz: 8ad87383113c90650399b01a68c6a8fc5d9031736afc906ae1bef7164661f2b0531e10afe9c2905e7b372e1752ebe679de1f76c1736df709363f9e15526bf2d0
7
+ data.tar.gz: f88bfc674fbd48e16e47e7ee3f1ac20f98bc58984522f6152a6945445666fe96bb6fafcd2ef2d6c2723e1e0c14e451dc0a1df7d33c1ad0628ec3c5c2d61bbb94
data/README.md CHANGED
@@ -13,4 +13,12 @@ gem install rails_options
13
13
  ```shell
14
14
  # add migrations to app/db/migrations directory
15
15
  rails g rails_options:install
16
+ ```
17
+
18
+ ## seeds
19
+ ```rb
20
+ RailsOptions::Option.create(slug: 'site_title', value: '网站标题')
21
+ RailsOptions::Option.create(slug: 'site_slogan', value: '网站口号')
22
+ RailsOptions::Option.create(slug: 'site_description', value: '网站描述')
23
+ RailsOptions::Option.create(slug: 'site_keywords', value: 'php,python,java')
16
24
  ```
@@ -1,5 +1,7 @@
1
1
  module RailsOptions
2
2
  class Option < ApplicationRecord
3
+ self.table_name = "rails_options"
4
+
3
5
  before_save :generate_slug
4
6
  validates_uniqueness_of :slug
5
7
 
@@ -0,0 +1,10 @@
1
+ class CreateRailsOptions < ActiveRecord::Migration[6.1]
2
+ def change
3
+ create_table :rails_options do |t|
4
+ t.string :slug
5
+ t.string :value
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -1,3 +1,3 @@
1
1
  module RailsOptions
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_options
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - afeiship
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-16 00:00:00.000000000 Z
11
+ date: 2022-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -37,7 +37,7 @@ files:
37
37
  - app/models/rails_options/application_record.rb
38
38
  - app/models/rails_options/option.rb
39
39
  - config/routes.rb
40
- - db/migrate/20220316133202_create_rails_options_options.rb
40
+ - db/migrate/20220316133202_create_rails_options.rb
41
41
  - lib/generators/rails_options/install/install_generator.rb
42
42
  - lib/rails_options.rb
43
43
  - lib/rails_options/engine.rb
@@ -1,11 +0,0 @@
1
- class CreateRailsOptionsOptions < ActiveRecord::Migration[6.1]
2
- def change
3
- create_table :rails_options_options do |t|
4
- t.string :slug
5
- t.string :value
6
- t.text :content
7
-
8
- t.timestamps
9
- end
10
- end
11
- end