table-for 3.4.0 → 3.4.1

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: 8719b9d60d0575d808cd0e59db4da06669581cff
4
- data.tar.gz: 5365a9d7259191c5b11895eb47320663a89b68c1
3
+ metadata.gz: a3533f2825ffff2f3b66f417e90842b92cf0aa7b
4
+ data.tar.gz: f289fb64ff8ee7bc3325193caad41cd14dba36ba
5
5
  SHA512:
6
- metadata.gz: c4a894bbb863ca45c866c1710ea119cdf11abc2cf8355d907ff4f89a63e6ee83ea7495421f43fcf1a7335a9672186d4a098afec49a76ee0e94a0e2742e06d06e
7
- data.tar.gz: 0a9e4f2628c39dfe85acd549ea1aee6553437b9fdc633489e377c196b63b50a35312471bff12752789392d542b5321af7503f6089351c0df66ec823e77c61309
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:
@@ -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
- [options[:link_action], options[:link_namespace], record].flatten.compact
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?
@@ -1,3 +1,3 @@
1
1
  module TableFor
2
- VERSION = "3.4.0"
2
+ VERSION = "3.4.1"
3
3
  end
@@ -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.0
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: 2015-12-22 00:00:00.000000000 Z
11
+ date: 2016-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails