controller_scaffolding 1.1.1 → 1.2.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.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -4
  3. data/lib/controller_scaffolding/version.rb +1 -1
  4. data/lib/generators/haml/controller/controller_scaffolding_generator.rb +10 -1
  5. data/test/dummy/app/models/credit_card_info.rb +2 -2
  6. data/test/dummy/db/test.sqlite3 +0 -0
  7. data/test/dummy/log/development.log +2 -0
  8. data/test/dummy/log/test.log +12242 -0
  9. data/test/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  10. data/test/dummy/tmp/cache/assets/test/sprockets/1a3c6a30280d9edd208e090bd63e93f3 +0 -0
  11. data/test/dummy/tmp/cache/assets/test/sprockets/1dc2824e4f69b5f787cc0b33a280e1f7 +0 -0
  12. data/test/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  13. data/test/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  14. data/test/dummy/tmp/cache/assets/test/sprockets/648c2e4578a1b3733059887e5541a92a +0 -0
  15. data/test/dummy/tmp/cache/assets/test/sprockets/7b3b5b9639a0645b8006aae3f7739bba +0 -0
  16. data/test/dummy/tmp/cache/assets/test/sprockets/8c0b04415ee487129c0d2bc8b098fb8c +0 -0
  17. data/test/dummy/tmp/cache/assets/test/sprockets/991d9baf4c0665d4114d00882965f72c +0 -0
  18. data/test/dummy/tmp/cache/assets/test/sprockets/9dfd4b1a01f3051eab1f5917c3b7e140 +0 -0
  19. data/test/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  20. data/test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  21. data/test/dummy/tmp/cache/assets/test/sprockets/d9a48b188723fa8a03d0f673046b0fc7 +0 -0
  22. data/test/dummy/tmp/cache/assets/test/sprockets/d9ad301878886b21cb9b44509bb894ee +0 -0
  23. data/test/dummy/tmp/cache/assets/test/sprockets/e1096456df20861d666f73523b3a56d1 +0 -0
  24. data/test/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  25. data/test/lib/generators/dummy_test_files/app/models/dinosaur.rb +1 -1
  26. data/test/lib/generators/dummy_test_files/app/models/person.rb +1 -1
  27. data/test/lib/tmp/app/models/dinosaur.rb +1 -1
  28. data/test/lib/tmp/app/models/person.rb +1 -1
  29. metadata +12 -6
  30. data/test/dummy/tmp/pids/server.pid +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8365f50379af89a274eb1e6461c0e9d0c1f584da
4
- data.tar.gz: ad8e187905f697a1ac3776054546901f802b1163
3
+ metadata.gz: e8ddc14b49898c2f28ac9099b247497f75b8cf69
4
+ data.tar.gz: 83f2105e1597867a97c840103d2e94b8fbb66fb7
5
5
  SHA512:
6
- metadata.gz: 684d37c11712a4760ff69a46a3421b000bd910074d6966ba15f884c70c294151205f642ee011e34180b56b1909c77a2bec10367da95fc3b9155822e133c94e27
7
- data.tar.gz: e98e2da6e2018c308b09eee35e9bc3a24d209b277a6f1d8976f80b60fc29036b453068ce5a7c39067c94ca8bb59a1054090b21a0d385512ad410e7c46b157630
6
+ metadata.gz: 4d035109c9323eddc7d481650cf633affdff5007fa97d228b992403f907427c045cbfb09e473daadcbf1bc94c319a2639176be22bd66815f312bc07f76a88a68
7
+ data.tar.gz: 42543180b4eeba24dfdf86b5d3a37753b85a84e2d7beb7042b699cba0b2d0d7fc1a18e329b688151808c688394268d784f7dba806bf0f97f3da41d27fb065473
data/README.md CHANGED
@@ -7,8 +7,6 @@ The generator acts somewhat like scaffolding, but you must specify an *existing*
7
7
 
8
8
  \* https://github.com/jomalley2112/sql_search_n_sort
9
9
 
10
- #### Current Issues ####
11
- * made 2 intermittently failing specs in people_spec pending
12
10
 
13
11
  #### Index page ####
14
12
  ![Index](/readme_assets/index_ss.png?raw=true "Index")
@@ -23,8 +21,13 @@ and then run `bundle install`
23
21
 
24
22
 
25
23
  #### Usage ####
24
+ Real Example:
26
25
  ```bash
27
- $ rails g|d controller_scaffolding users index new create edit update destroy --template-engine=haml
26
+ $ rails g controller_scaffolding users index new create edit update destroy --template-engine=haml --skip-assets --skip-test-framework --skip-helper
27
+ ```
28
+ All Options:
29
+ ```bash
30
+ $ rails g|d controller_scaffolding plural_model_name action1 action2 action3 --template-engine=haml
28
31
  [--skip-ext-index-nav] [--skip-ext-form-submit] [--skip-assets] [--skip-test-framework] [--skip-helper] [--quiet] [--force] [--skip-search-sort]
29
32
  ```
30
33
 
@@ -101,7 +104,7 @@ $ rails g|d controller_scaffolding users index new create edit update destroy --
101
104
  - 'haml-rails'
102
105
  - 'sass-rails', '~> 4.0.3'
103
106
  - 'jquery-rails'
104
- - 'sql_search_n_sort', '=1.15'
107
+ - 'sql_search_n_sort', '=2.0.0'
105
108
 
106
109
  #### Development Environment Dependencies ####
107
110
  - "sqlite3"
@@ -1,3 +1,3 @@
1
1
  module ControllerScaffolding
2
- VERSION = "1.1.1"
2
+ VERSION = "1.2.0"
3
3
  end
@@ -95,9 +95,10 @@ module Haml
95
95
  before: /^end/ do
96
96
  "\n\textend SqlSearchableSortable\n"
97
97
  end
98
+ #binding.pry
98
99
  inject_into_file "app/models/#{table_name.singularize}.rb",
99
100
  before: /^end/ do
100
- "\n\tsql_searchable #{cols_to_symbols}\n"
101
+ "\n\tsql_searchable #{searchable_cols_as_symbols}\n"
101
102
  end
102
103
  inject_into_file "app/models/#{table_name.singularize}.rb",
103
104
  before: /^end/ do
@@ -116,7 +117,15 @@ module Haml
116
117
  #================================= P R I V A T E =====================================
117
118
  private
118
119
 
120
+ def searchable_cols_as_symbols
121
+ puts "!!!="+@attr_cols.select{ |col| [:string, :text].include? col.type}
122
+ .map { |col| col.name.to_sym }.to_s.gsub(/\[(.*)\]/, '\1')
123
+ @attr_cols.select{ |col| [:string, :text].include? col.type}
124
+ .map { |col| col.name.to_sym }.to_s.gsub(/\[(.*)\]/, '\1')
125
+ end
126
+
119
127
  def cols_to_symbols
128
+
120
129
  #ugly, but I can't find another way to keep the symbols
121
130
  @attr_cols.map { |col| col.name.to_sym }.to_s.gsub(/\[(.*)\]/, '\1')
122
131
  end
@@ -1,3 +1,3 @@
1
- class CreditCardInfo < ActiveRecord::Base
2
-
1
+ class CreditCardInfo < ActiveRecord::Base
2
+
3
3
  end
Binary file
@@ -14477,3 +14477,5 @@ Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2014-08-21 11:49:4
14477
14477
 
14478
14478
 
14479
14479
  Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2014-08-21 11:50:29 -0400
14480
+ Person Load (0.3ms) SELECT "people".* FROM "people" ORDER BY "people"."id" ASC LIMIT 1
14481
+ Person Load (1.2ms) SELECT "people".* FROM "people"