table-for 3.4.0 → 3.4.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 +4 -4
- data/CHANGELOG.rdoc +4 -0
- data/lib/table_for/base.rb +5 -1
- data/lib/table_for/version.rb +1 -1
- data/spec/integration/table_for_spec.rb +15 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3533f2825ffff2f3b66f417e90842b92cf0aa7b
|
4
|
+
data.tar.gz: f289fb64ff8ee7bc3325193caad41cd14dba36ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87a9393fb42dd5506b3c2ea181703b0d048c181f7d4e40b7cf8b13438d35b04f2d6b5d681bee59e555877fc6d061df40abffe61284fcf93cad3ccb0c5611d3f4
|
7
|
+
data.tar.gz: 7d084afb99618c8f1b5952de9020ae821ff313b807d3e7f9d833ddb4e2b4f8361033aefa99dbb6cc8608b01c5ea54e937b65b05a7753b085f8285ea990bd649d
|
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
3.4.1
|
2
|
+
* Fixed bug introduced in version 3.4.0 where link_namespace defined globally
|
3
|
+
on the table_for call was getting completely ignored. Thanks @panyamin for reporting.
|
4
|
+
|
1
5
|
3.4.0
|
2
6
|
* Links options that are applied to a column will now generate the link even if you override
|
3
7
|
column. In haml, this example pointed out by @noctivityinc, now works:
|
data/lib/table_for/base.rb
CHANGED
@@ -33,7 +33,11 @@ module TableFor
|
|
33
33
|
url = if options[:link_url]
|
34
34
|
call_with_params(options[:link_url], record)
|
35
35
|
else
|
36
|
-
[
|
36
|
+
[
|
37
|
+
options[:link_action],
|
38
|
+
options[:link_namespace] || global_options[:link_namespace],
|
39
|
+
record
|
40
|
+
].flatten.compact
|
37
41
|
end
|
38
42
|
html_options = {data: {}}
|
39
43
|
html_options[:data][:method] = options[:link_method] if options[:link_method].present?
|
data/lib/table_for/version.rb
CHANGED
@@ -548,6 +548,21 @@ describe "table_for" do
|
|
548
548
|
html_includes?(buffer, "<a href='/admin/users/1'>andrew.hunter@livingsocial.com</a>")
|
549
549
|
end
|
550
550
|
|
551
|
+
it "should use the globally defined link_namespace unless defined directly on the column" do
|
552
|
+
@view.class.send(:define_method, :admin_user_path) do |user|
|
553
|
+
"/admin/users/#{user.id}"
|
554
|
+
end
|
555
|
+
@view.class.send(:define_method, :profile_user_path) do |user|
|
556
|
+
"/profile/users/#{user.id}"
|
557
|
+
end
|
558
|
+
buffer = @view.table_for @users, link_namespace: :admin do |table|
|
559
|
+
table.column :email, link: true
|
560
|
+
table.column :id, link_namespace: :profile, link: true
|
561
|
+
end
|
562
|
+
html_includes?(buffer, "<a href='/admin/users/1'>andrew.hunter@livingsocial.com</a>")
|
563
|
+
html_includes?(buffer, "<a href='/profile/users/1'>1</a>")
|
564
|
+
end
|
565
|
+
|
551
566
|
it "should be able to replace an individual column data contents block" do
|
552
567
|
buffer = @view.table_for @users[0,1] do |table|
|
553
568
|
table.column :email, :header => "Email Address"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: table-for
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Hunter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|