ez 0.9.9 → 1.0.0

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: c1435cdce1c508b5097a63994d5410bacc4d70b0
4
- data.tar.gz: c45bc846995af9ff76cd7b4ae516f1bb9d9921b0
3
+ metadata.gz: dc7371a54621cea994857087bcf5d613e717247c
4
+ data.tar.gz: 97ba31197de369c56fa907d157508ac5a82b3da4
5
5
  SHA512:
6
- metadata.gz: 4531ea674bbd3fb547aeda0ab8ed898592292a6997497aecc46637b5917693a45f56b3137c9c3057d02bc96909eb0fc3fa53034d95f2ba05d8591c75de3d5162
7
- data.tar.gz: 9b13d85e4e0ed661244b87e7cb3a485131904da9adb7e1c967a72363cfdf4c487a681b5fc1c4048031273d372de1539ba440f06ef81d97b5843561acc80adcb6
6
+ metadata.gz: 6b579317552b30d8b6619ca7ad3cd03768e1a5cb036ba1779fd7c8d9fab8fa307039df0bc92faf43098a29f1a47032eb6fbb05e2bd6f0ce072b148dc187f9ed6
7
+ data.tar.gz: 5273b89d19801fcfb4844672bf401be35f8da0e4a0ba9bf9c74ba64629ce7227d8dd88959921870eab9d508a98f68af9fd7403db77b18cfd10c8a8b33c517be7
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # EZ
2
2
 
3
- **Version 0.9.8**
3
+ **Version 0.9.9**
4
4
 
5
5
  *For educational purposes only.*
6
6
 
@@ -22,11 +22,11 @@ Then:
22
22
 
23
23
  ## Summary of Best Practices
24
24
 
25
- 1. Use `db/models.yml` to define your schema. Foreign-key indexes will be generated automatically. (This should cover 100% of what most beginners will ever need to do.)
25
+ 1. Use `db/models.yml` to define your schema. Foreign-key indexes will be generated automatically. (This step by itself should cover 100% of what most beginners will ever need to do.)
26
26
 
27
27
  2. Use Rails migrations for any additional indexes, database constraints, etc.
28
28
 
29
- 3. Just use `rake db:migrate` as usual. Nothing new to learn.
29
+ 3. Overall, just use `rake db:migrate` as usual.
30
30
 
31
31
 
32
32
 
@@ -38,11 +38,10 @@ Then:
38
38
  * Enables **instant domain modeling without migrations** by using a file named `db/models.yml`.
39
39
  * No new rake tasks to learn. This gem enhances `db:migrate` to incorporate the `db/models.yml` file automatically.
40
40
  * You can run `rake db:migrate` to initially generate a file named `db/models.yml`. It will have some self-documenting comments inside of it.
41
- * In development mode, there's no need to ever run `rake db:migrate`! Every brower request will trigger automatic table updates.
41
+ * In development mode, there's no need to ever run `rake db:migrate`! Every browser request will trigger automatic table updates.
42
42
  * In the rails console, 'reload!' will also trigger table updates.
43
- * If you prefer, you can run `rake db:migrate` whenever you modify `db/models.yml`.
44
- * `rake db:migrate` will run any pending migrations *after* following instructions in the `db/models.yml` file.
45
-
43
+ * If you prefer, just run `rake db:migrate` whenever you modify `db/models.yml`.
44
+ * `rake db:migrate` will run any pending migrations *after* any table updates from the `db/models.yml` file.
46
45
 
47
46
 
48
47
  **Syntax Guide for `db/models.yml`**
@@ -89,8 +89,8 @@ module EZ
89
89
  parse_model_spec
90
90
 
91
91
  # puts "@spec:"
92
- puts @spec.inspect
93
- puts "-" * 10
92
+ # puts @spec.inspect
93
+ # puts "-" * 10
94
94
  end
95
95
 
96
96
  def load_model_specs(filename = "db/models.yml")
@@ -136,11 +136,15 @@ module EZ
136
136
  end
137
137
  end
138
138
 
139
- default_column_value = (column_type == 'boolean' ? false : nil)
139
+ default_column_value = nil
140
140
  DEFAULT_VALUE_REGEXES.each { |r| default_column_value = $1 if column_type.sub!(r, '') }
141
141
  default_column_value = default_column_value.to_i if column_type == 'integer'
142
142
  default_column_value = default_column_value.to_f if column_type == 'float'
143
143
 
144
+ if column_type == 'boolean'
145
+ default_column_value = default_column_value.present? && default_column_value.downcase.strip == 'true'
146
+ end
147
+
144
148
  @spec[model][column_name] = { type: column_type, default: default_column_value}
145
149
  @spec[model][column_name][:index] = true if column_name =~ /_id$/
146
150
  end
@@ -1,3 +1,3 @@
1
1
  module EZ
2
- VERSION = "0.9.9"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ez
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.9
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Cohen