active_scaffold 3.4.35 → 3.4.36

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 047204c7ed281db3ab039a622cde11ad71d7a7d6
4
- data.tar.gz: c60b1312ef3aa2e21edeaaa25ff8d4e432cf3142
3
+ metadata.gz: 83c0925aecdf8e8cb67457796ee92dda1238e643
4
+ data.tar.gz: ca9244cc82582adb62affbd49e316d5b4a5bafd4
5
5
  SHA512:
6
- metadata.gz: 13d05fe3a97d1cc2542dc01074ad250f2e2dfe6a4ae56ceb55875360b966254d942463b3286a2b11e911b9bbbe645c741021c11232eaff749886d46152ee410d
7
- data.tar.gz: 63e0aa647cf1bdd0f527c201f851dfc349cf6cb8626e752feba3d065cb0ead2a312c5a429c28a72b3df9d8b11af800526b47d231d8b73f934c2c13b34202540d
6
+ metadata.gz: 5bf876c309a71dd8a954782e51ce23ff8a20dc937f5562a110cd9814909f9bdd16c0da239cd40c2b79045895235194638d7b0383d68853e031e537b713892ef8
7
+ data.tar.gz: d7aef2c46b06c3a13a980ae5faf7f1df628802921643a9a92784f4b55066406f7b7da2a99e25c40c5307a0c7ad324d37dc8cd408d7166bf3d037eb7b4ee3e3a1
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ = 3.4.36
2
+ - Fix tableless for rails >= 4.1 for associations with table
3
+ - use number_with_precision for non-integer numbers with i18n_number format, so strip_insignificant_zeros and precision can be used
4
+
5
+ = 3.4.35
1
6
  - Fix JS error on update columns when request fails and form is loaded on page
2
7
  - Not raise exception when trying to scroll to missing element
3
8
  - Fix error on rails 3.2 caused by a workaround to fix eager load HABTM with scope on rails 4.2
@@ -8,7 +8,9 @@ action_link.update_flash_messages('<%= escape_javascript(render(:partial => 'mes
8
8
  ActiveScaffold.update_row('<%= row_selector %>', '<%= escape_javascript(render(:partial => 'list_record', :locals => {:record => @record})) %>');
9
9
  action_link.target = $('#<%= row_selector %>');
10
10
  <%= render :partial => 'update_calculations', :formats => [:js] %>
11
- <%= "ActiveScaffold.enable_form('#{form_selector}');" if params[:iframe] == 'true' %>
11
+ <% if params[:iframe] == 'true' %>
12
+ ActiveScaffold.enable_form('<%= form_selector %>');
13
+ <% end %>
12
14
  <% else %>
13
15
  <% if render_parent? %>
14
16
  <% if nested_singular_association? || render_parent_action == :row %>
@@ -132,7 +132,7 @@ module ActiveScaffold
132
132
  when :currency
133
133
  number_to_currency(value, options[:i18n_options] || {})
134
134
  when :i18n_number
135
- number_with_delimiter(value, options[:i18n_options] || {})
135
+ send("number_with_#{value.is_a?(Integer) ? 'delimiter' : 'precision'}", value, options[:i18n_options] || {})
136
136
  else
137
137
  value
138
138
  end
@@ -4,7 +4,9 @@ class ActiveScaffold::Tableless < ActiveRecord::Base
4
4
  klass = alias_tracker ? alias_tracker.connection.klass : self.klass
5
5
  if table_name == klass.table_name
6
6
  klass.columns_hash[column_name]
7
- else
7
+ elsif alias_tracker && (klass = alias_tracker.instance_variable_get(:@assoc_klass))
8
+ klass.columns_hash[column_name]
9
+ else # rails < 4.1
8
10
  association.klass.columns_hash[column_name]
9
11
  end
10
12
  end
@@ -14,6 +16,11 @@ class ActiveScaffold::Tableless < ActiveRecord::Base
14
16
  def self.scope(association, connection)
15
17
  INSTANCE.scope association, connection
16
18
  end
19
+
20
+ def add_constraints(scope, owner, assoc_klass, refl, tracker)
21
+ tracker.instance_variable_set(:@assoc_klass, assoc_klass)
22
+ super
23
+ end
17
24
  end
18
25
  end
19
26
 
@@ -2,7 +2,7 @@ module ActiveScaffold
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 4
5
- PATCH = 35
5
+ PATCH = 36
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
@@ -0,0 +1,16 @@
1
+ namespace :brakeman do
2
+ desc 'Run Brakeman'
3
+ task :run, :output_files do |_t, args|
4
+ require 'brakeman'
5
+
6
+ files = args[:output_files].split(' ') if args[:output_files]
7
+ Brakeman.run app_path: '.', output_files: files, print_report: true
8
+ end
9
+
10
+ desc 'Check your code with Brakeman'
11
+ task :check do
12
+ require 'brakeman'
13
+ result = Brakeman.run app_path: '.', print_report: true
14
+ exit Brakeman::Warnings_Found_Exit_Code unless result.filtered_warnings.empty?
15
+ end
16
+ end
data/test/test_helper.rb CHANGED
@@ -1,5 +1,7 @@
1
- require 'simplecov'
2
- SimpleCov.start { add_filter 'test' }
1
+ if RUBY_ENGINE == 'ruby'
2
+ require 'simplecov'
3
+ SimpleCov.start { add_filter 'test' }
4
+ end
3
5
 
4
6
  ENV['RAILS_ENV'] = 'test'
5
7
  require 'mock_app/config/environment'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_scaffold
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.35
4
+ version: 3.4.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - Many, see README
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-16 00:00:00.000000000 Z
11
+ date: 2016-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -331,6 +331,7 @@ files:
331
331
  - lib/generators/active_scaffold_controller/active_scaffold_controller_generator.rb
332
332
  - lib/generators/active_scaffold_controller/templates/controller.rb
333
333
  - lib/generators/active_scaffold_controller/templates/helper.rb
334
+ - lib/tasks/brakeman.rake
334
335
  - public/blank.html
335
336
  - shoulda_macros/macros.rb
336
337
  - test/bridges/bridge_test.rb
@@ -444,7 +445,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
444
445
  version: '0'
445
446
  requirements: []
446
447
  rubyforge_project:
447
- rubygems_version: 2.5.2
448
+ rubygems_version: 2.4.8
448
449
  signing_key:
449
450
  specification_version: 4
450
451
  summary: Rails 3.2, 4.0, 4.1 and 4.2 versions of ActiveScaffold supporting prototype