active_list 6.7.0 → 6.7.1

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: 775b3110948e7e0da35e95a8e44f6c0ffe2e01c0
4
- data.tar.gz: a5d9ae7e758ea41b87666316ddcd35be1510283e
3
+ metadata.gz: 3cecbf76e01e595246bbb04a0b7044f50ffab69f
4
+ data.tar.gz: 68c617c967d87b26d84878e905ab940dba1d7672
5
5
  SHA512:
6
- metadata.gz: bd143bcd93b403eef747ba74b118d5c30f5ffec7beee2625ece0a6272e0a54180f83329790f2fab3c99c9cf0e26cfc76dfdec4977cc4ee5ab60d278c700d0407
7
- data.tar.gz: 77cd8e43c60e2d63cc95eeb6c681a66bb21193c26184c556e3717e5be642ec6e0dad8a4d7fb00cd1b8f97a677dc460427ab32a0adb8d0a0c05b0f8175e4b5f14
6
+ metadata.gz: f3dee8f29af9611143fb3a8c4d9b0a6726cf00864757fb9ae6638ab90594d9892236184fc55eb88921dac090cbe87b8b0cfbc43ed36c939551ad2827082ea573
7
+ data.tar.gz: 906b073783e17804e403f977f38a8fb67dbeb648490b3c6efa4b5e6575abb65218273e7dc8dc904e0e12ed124b1a5008149169054aee71048a62ce99869c2c2f
@@ -302,8 +302,8 @@ module ActiveList
302
302
  code << " data-list-column-sort=\"'+(#{var_name(:params)}[:sort] != '#{column.sort_id}' ? 'asc' : #{var_name(:params)}[:dir] == 'asc' ? 'desc' : 'asc')+'\"" if column.sortable?
303
303
  code << " data-list-column-computation=\"#{column.computation_method}\"" if column.computable?
304
304
  if column.is_a?(ActiveList::Definition::DataColumn) && column.options[:currency]
305
- code << " data-list-column-currency-symbol=\"' + Nomen::Currencies[#{generator.records_variable_name}.first.currency].symbol + '\""
306
- code << " data-list-column-currency-precision=\"' + Nomen::Currencies[#{generator.records_variable_name}.first.currency].precision.to_s + '\""
305
+ code << " data-list-column-currency-symbol=\"' + Nomen::Currencies[#{generator.records_variable_name}.first && #{generator.records_variable_name}.first.currency].symbol + '\""
306
+ code << " data-list-column-currency-precision=\"' + Nomen::Currencies[#{generator.records_variable_name}.first && #{generator.records_variable_name}.first.currency].precision.to_s + '\""
307
307
  end
308
308
  code << " class=\"#{column_classes(column, true, true)}\""
309
309
  code << '>'
@@ -1,3 +1,3 @@
1
1
  module ActiveList
2
- VERSION = '6.7.0'
2
+ VERSION = '6.7.1'
3
3
  end
@@ -1,6 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'rails', '3.2.17'
3
+ gem 'rails', '4.2.7'
4
4
 
5
5
  # Bundle edge Rails instead:
6
6
  # gem 'rails', :git => 'git://github.com/rails/rails.git'
@@ -11,8 +11,8 @@ gem 'active_list', path: '../..'
11
11
  # Gems used only for assets and not required
12
12
  # in production environments by default.
13
13
  group :assets do
14
- gem 'sass-rails', '~> 3.2.3'
15
- gem 'coffee-rails', '~> 3.2.1'
14
+ gem 'sass-rails', '~> 4'
15
+ gem 'coffee-rails', '~> 4'
16
16
 
17
17
  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
18
18
  gem 'therubyracer', platform: :ruby
@@ -1,4 +1,5 @@
1
1
  class ContactsController < ApplicationController
2
+
2
3
  # GET /contacts
3
4
  # GET /contacts.json
4
5
  def index
@@ -1,5 +1,7 @@
1
1
  class PeopleController < ApplicationController
2
- list
2
+ list do |t|
3
+ t.column :balance_amount, currency: true
4
+ end
3
5
 
4
6
  # GET /people
5
7
  # GET /people.json
@@ -1,5 +1,7 @@
1
1
  <h1>Listing contacts</h1>
2
2
 
3
+ <%= list -%>
4
+
3
5
  <table>
4
6
  <tr>
5
7
  <th>Person</th>
@@ -26,6 +28,8 @@
26
28
  <% end %>
27
29
  </table>
28
30
 
31
+
32
+
29
33
  <br />
30
34
 
31
35
  <%= link_to 'New Contact', new_contact_path %>
@@ -53,6 +53,8 @@ module Dummy
53
53
  # Enable the asset pipeline
54
54
  config.assets.enabled = true
55
55
 
56
+ config.eager_load = false
57
+
56
58
  # Version of your assets, change this if you want to expire all your assets
57
59
  config.assets.version = '1.0'
58
60
  end
@@ -27,7 +27,7 @@ Dummy::Application.configure do
27
27
 
28
28
  # Log the query plan for queries taking more than this (works
29
29
  # with SQLite, MySQL, and PostgreSQL)
30
- config.active_record.auto_explain_threshold_in_seconds = 0.5
30
+ # config.active_record.auto_explain_threshold_in_seconds = 0.5
31
31
 
32
32
  # Do not compress assets
33
33
  config.assets.compress = false
@@ -53,6 +53,7 @@ Dummy::Application.configure do
53
53
 
54
54
  # Enable threaded mode
55
55
  # config.threadsafe!
56
+ config.eager_load = true
56
57
 
57
58
  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
58
59
  # the I18n.default_locale when a translation can not be found)
@@ -11,8 +11,8 @@ Dummy::Application.configure do
11
11
  config.cache_classes = true
12
12
 
13
13
  # Configure static asset server for tests with Cache-Control for performance
14
- config.serve_static_files = true
15
- config.static_cache_control = 'public, max-age=3600'
14
+ # config.public_file_server.enabled = true
15
+ # config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
16
16
 
17
17
  # Log error messages when you accidentally call methods on nil
18
18
  # config.whiny_nils = true
@@ -4,6 +4,8 @@ class CreatePeople < ActiveRecord::Migration
4
4
  t.string :name
5
5
  t.date :born_on
6
6
  t.decimal :height
7
+ t.decimal :balance_amount
8
+ t.string :currency
7
9
 
8
10
  t.timestamps null: false
9
11
  end
@@ -27,8 +27,10 @@ ActiveRecord::Schema.define(version: 20120510134500) do
27
27
  t.string "name"
28
28
  t.date "born_on"
29
29
  t.decimal "height"
30
- t.datetime "created_at", null: false
31
- t.datetime "updated_at", null: false
30
+ t.decimal "balance_amount"
31
+ t.string "currency"
32
+ t.datetime "created_at", null: false
33
+ t.datetime "updated_at", null: false
32
34
  end
33
35
 
34
36
  end
@@ -1,3 +1,4 @@
1
+ require 'byebug'
1
2
  require 'test_helper'
2
3
 
3
4
  class PeopleControllerTest < ActionController::TestCase
@@ -12,6 +13,11 @@ class PeopleControllerTest < ActionController::TestCase
12
13
  assert_response :success
13
14
  end
14
15
 
16
+ test 'rendering on empty list' do
17
+ Person.destroy_all
18
+ get :list
19
+ end
20
+
15
21
  test 'parameters' do
16
22
  get :list, 'people-id' => 10
17
23
  assert_response :success
@@ -7,6 +7,7 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
7
7
  require 'active_list'
8
8
  dummy_path = Pathname.new(__FILE__).dirname.join('dummy')
9
9
 
10
+ ENV["BUNDLE_GEMFILE"] = ""
10
11
  Kernel.system("cd #{dummy_path} && bundle install && bundle exec rake db:drop db:create db:migrate db:seed RAILS_ENV=test")
11
12
 
12
13
  # CURRENT FILE :: test/test_helper.rb
@@ -21,6 +22,19 @@ ActionMailer::Base.delivery_method = :test
21
22
  ActionMailer::Base.perform_deliveries = true
22
23
  ActionMailer::Base.default_url_options[:host] = 'test.com'
23
24
 
25
+ module ActionView
26
+ class Base
27
+ module Nomen
28
+ class Currencies
29
+ def self.[](_)
30
+ klass = Struct.const_defined?(:Currency) ? Struct::Currency : Struct.new("Currency", :precision, :symbol)
31
+ return klass.new(2, "€")
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+
24
38
  Rails.backtrace_cleaner.remove_silencers!
25
39
 
26
40
  # Run any available migration
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_list
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.7.0
4
+ version: 6.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brice Texier
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '3.2'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: 5.1.0
22
+ version: 5.0.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '3.2'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: 5.1.0
32
+ version: 5.0.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: arel
35
35
  requirement: !ruby/object:Gem::Requirement