ez 1.5.0.4 → 1.5.0.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 +4 -4
- data/README.md +12 -6
- data/lib/ez/schema_modifier.rb +1 -1
- data/lib/ez/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0fde759ce0cea2b58fa8fc323a76158f93430173
|
4
|
+
data.tar.gz: 42a62ac0bc1a06d7c00a795e3c73bd348d0bc0b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6dfb9d16fcb8fdb9623047fba899708392feeb4d658c1a390b341ba696075210086135fdb500df5b2beb982e245d3bc75a289e98950ddee81cd75c106d4d81b5
|
7
|
+
data.tar.gz: f25f16f47bbe29c22c6f9a8e63e584d3daa01ecd07b3a64b92d63e818ed7b3cb9968e876b17d29abb86fb61263d88e95027be29bf9314668fc637451b32311d3
|
data/README.md
CHANGED
@@ -1,14 +1,20 @@
|
|
1
1
|
# EZ
|
2
2
|
|
3
|
-
**Version 1.5.0.
|
3
|
+
**Version 1.5.0.3**
|
4
4
|
|
5
5
|
*For educational purposes only.*
|
6
6
|
|
7
|
-
Tested against Rails 5.
|
7
|
+
Tested against Rails 5.1.1.
|
8
8
|
|
9
|
-
|
9
|
+
_NOTE: For Rails < 5.0, use version 1.3_.
|
10
10
|
|
11
|
-
|
11
|
+
Easy domain modeling in Rails without migrations.
|
12
|
+
|
13
|
+
* Applies instant schema changes based on a file named `db/models.yml`.
|
14
|
+
* Diffs are determined automatically and applied to the database.
|
15
|
+
* Embraces Rails' column naming conventions by inferring columns types based on the name.
|
16
|
+
* Enhances the rails console
|
17
|
+
* Provides extra ActiveRecord helper methods.
|
12
18
|
|
13
19
|
|
14
20
|
## Usage
|
@@ -33,7 +39,7 @@ to generate a skeleton `db/models.yml` that you should edit.
|
|
33
39
|
|
34
40
|
## Get Started
|
35
41
|
|
36
|
-
1. Run `
|
42
|
+
1. Run `rails db:migrate` to initially generate a file named `db/models.yml`.
|
37
43
|
|
38
44
|
2. Use `db/models.yml` to define your schema. Database schema changes are applied directly and triggered automatically in development mode. (`rake db:migrate` will also trigger the changes). Foreign-key indexes will be generated automatically.
|
39
45
|
|
@@ -161,7 +167,7 @@ Author
|
|
161
167
|
|
162
168
|
* Adds ActiveRecord::Base `.read` method so that models have complete *CRUD*: `.create`, `.read`, `.update`, and `.delete`. When given an integer, `.read` becomes a synonym for `.find`. When given a hash, it is a synonym for `.where`.
|
163
169
|
* Adds `.sample` method to choose a random row.
|
164
|
-
* Adds `.to_ez
|
170
|
+
* Adds `.to_ez` to generate a snippet from legacy models that you can paste into models.yml.
|
165
171
|
|
166
172
|
|
167
173
|
|
data/lib/ez/schema_modifier.rb
CHANGED
@@ -183,7 +183,7 @@ module EZ
|
|
183
183
|
begin
|
184
184
|
filename = "app/models/#{model_name.underscore}.rb"
|
185
185
|
code = IO.read(filename)
|
186
|
-
is_empty = IO.read(filename) =~ /\s*class #{model_name} <
|
186
|
+
is_empty = IO.read(filename) =~ /\s*class #{model_name} < ApplicationRecord\s+end\s*/
|
187
187
|
|
188
188
|
if is_empty
|
189
189
|
display_change "Deleting file #{filename}"
|
data/lib/ez/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ez
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.0.
|
4
|
+
version: 1.5.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Cohen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04
|
11
|
+
date: 2017-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hirb
|
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
98
|
version: '0'
|
99
99
|
requirements: []
|
100
100
|
rubyforge_project:
|
101
|
-
rubygems_version: 2.
|
101
|
+
rubygems_version: 2.6.11
|
102
102
|
signing_key:
|
103
103
|
specification_version: 4
|
104
104
|
summary: For educational purposes only.
|