beautiful_scaffold 0.2.5 → 0.2.6

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.
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.2.6
2
+
3
+ * Bugfix
4
+ * Thanks to : gregwis Problem with models ending with s (http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html#method-i-classify)
5
+
1
6
  == 0.2.5
2
7
 
3
8
  * enhancement
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "beautiful_scaffold"
6
- s.version = "0.2.5"
6
+ s.version = "0.2.6"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.summary = "Beautiful Scaffold generate fully customizable scaffold"
9
9
  s.email = "claudel.sylvain@gmail.com"
@@ -46,7 +46,7 @@ module BeautifulScaffoldCommonMethods
46
46
  end
47
47
 
48
48
  def model_class
49
- model.classify
49
+ model.camelize
50
50
  end
51
51
 
52
52
  # For the views
@@ -61,7 +61,7 @@ module BeautifulHelper
61
61
  model_path.delete(model_path.first)
62
62
  model_name_for_ransack = model_path.join("_")
63
63
 
64
- ar_model = model_name.classify.constantize
64
+ ar_model = model_name.camelize.constantize
65
65
 
66
66
  default_caption = caption
67
67
  if default_caption.blank? then
@@ -162,7 +162,7 @@ module BeautifulHelper
162
162
  response += f.text_field((name_field + "_cont").to_sym, :class => "filter span12")
163
163
  when :integer, :float, :decimal then
164
164
  if is_belongs_to_column?(name_field_bk) then
165
- btmodel = get_belongs_to_model(name_field_bk).classify.constantize
165
+ btmodel = get_belongs_to_model(name_field_bk).camelize.constantize
166
166
  response += f.collection_select((name_field + "_eq").to_sym, btmodel.all, :id, :caption, { :include_blank => t(:all, :default => "All") }, { :class => "span12" })
167
167
  elsif name_field == "id" then
168
168
  response += f.text_field((name_field + "_eq").to_sym, :class => "filter span12")
@@ -2,18 +2,18 @@
2
2
  <% if not namespace.blank? then %>
3
3
  <% formparams << namespace %>
4
4
  <% end %>
5
- <% formparams << model_name.classify.constantize.new %>
5
+ <% formparams << model_name.camelize.constantize.new %>
6
6
  <%= form_for formparams, :method => :post, :html => { :class => "well well-small form-horizontal mass-inserting" } do |f| %>
7
7
  <%= hidden_field_tag :mass_inserting, true %>
8
8
  <% for col in model_columns %>
9
9
  <div <%= visible_column(model_name, col, 'inline') %> class="col-<%= col %>">
10
10
  <%=
11
- ar = model_name.classify.constantize.columns_hash[col]
11
+ ar = model_name.camelize.constantize.columns_hash[col]
12
12
  if not ar.nil? then
13
13
  case ar.type
14
14
  when :integer then
15
15
  if col =~ /.*_id/ then
16
- f.collection_select((col).to_sym, col.classify.constantize.all, :id, :caption, { :include_blank => true, :selected => (begin params[:q][col + "_eq"].to_i rescue '' end) }, { :class => "input-small" })
16
+ f.collection_select((col).to_sym, col.camelize.constantize.all, :id, :caption, { :include_blank => true, :selected => (begin params[:q][col + "_eq"].to_i rescue '' end) }, { :class => "input-small" })
17
17
  else
18
18
  f.text_field(col.to_sym, :class => "input-small", :placeholder => t(col.to_sym, :default => col).capitalize)
19
19
  end
@@ -25,7 +25,7 @@
25
25
  f.text_field(col.to_sym, :class => "input-small", :placeholder => t(col.to_sym, :default => col).capitalize)
26
26
  end
27
27
  else
28
- f.collection_select((col + '_id').to_sym, col.classify.constantize.all, :id, :caption, { :include_blank => true, :selected => (begin params[:q][col + "_id_eq"].to_i rescue '' end) }, { :class => "input-small" })
28
+ f.collection_select((col + '_id').to_sym, col.camelize.constantize.all, :id, :caption, { :include_blank => true, :selected => (begin params[:q][col + "_id_eq"].to_i rescue '' end) }, { :class => "input-small" })
29
29
  end
30
30
  %>
31
31
  </div>
@@ -5,7 +5,7 @@
5
5
  <h3><%%= t(:register, :default => "Register") %></h3>
6
6
  </div>
7
7
  <div class="modal-body">
8
- <%% resource ||= <%= model.classify %>.new %>
8
+ <%% resource ||= <%= model.camelize %>.new %>
9
9
  <%%= form_for(resource, :as => '<%= model %>', :url => registration_path('<%= model %>'), :html => { :class => "form-horizontal" }) do |f| %>
10
10
  <%% begin %>
11
11
  <%%= devise_error_messages! %>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beautiful_scaffold
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-04 00:00:00.000000000Z
12
+ date: 2013-01-28 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Beautiful Scaffold generate a complete scaffold (sort, export, paginate
15
15
  and filter data) http://www.beautiful-scaffold.com
@@ -254,7 +254,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
254
254
  version: '0'
255
255
  requirements: []
256
256
  rubyforge_project: beautiful_scaffold
257
- rubygems_version: 1.8.10
257
+ rubygems_version: 1.8.24
258
258
  signing_key:
259
259
  specification_version: 3
260
260
  summary: Beautiful Scaffold generate fully customizable scaffold