card-mod-lookup 0.1 → 0.2

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
  SHA256:
3
- metadata.gz: b4215382b1478803a91069e8f71e7a980a64d632c2d5b62e1bd69cf5fb0c7cbe
4
- data.tar.gz: 746772c19ae1fa95a3d685a8f8befd8d2d2b516033908d99ae82a7ce0175eeed
3
+ metadata.gz: d77f0f0886a1501eb9348fe19e42575ddfac1b74a0a8083d133919cc9c74807b
4
+ data.tar.gz: 5814cbfda2b15d6c2b4903474940908539121449d83b79528ce048c04bedd688
5
5
  SHA512:
6
- metadata.gz: 03eef8d51212c24dffb854ea9d1727c8accd0cb1371a4d46f0b3c05ae478b209c3bd3cd86946ee9a4637e18513126fc342b26d9a7395f5656baaa45972df8c07
7
- data.tar.gz: 3eab763cc4378322b543659203326ab436a4990b6ec8be550e5b2b97bd2ed4714c74e54db61c310b9eae44cb6e8573d426f4ee45baa0a370c53ebcd7f686ca3f
6
+ metadata.gz: bcabc55ee2467ea1bde04d59a735d4d5d86cb240186232ccde7c7ff4a774d6d1f126fb2c3a834211b38e459029f2481ce0745ead932f5b168c32d47e9ac458e5
7
+ data.tar.gz: 9e11d30ff675d7e87d2976488cbf45808cf436682210707366f0bf8b25f9884b4d835c9c873be32fbac0dac5a5bd0ac778a5143938e109438d15a59becb7605e
@@ -45,10 +45,10 @@ class Card
45
45
  end
46
46
 
47
47
  def to_card_id value
48
- if value.is_a?(Array)
49
- value.map { |v| Card.fetch_id(v) }
48
+ if value.is_a? Array
49
+ value.map(&:card_id)
50
50
  else
51
- Card.fetch_id(value)
51
+ value.card_id
52
52
  end
53
53
  end
54
54
 
@@ -65,7 +65,7 @@ class Card
65
65
 
66
66
  def restrict_by_cql col, cql
67
67
  cql.reverse_merge! return: :id, limit: 0
68
- restrict_to_ids col, Card.search(cql)
68
+ @conditions << "#{filter_table col}.#{col} IN (#{Card::Query.new(cql).sql})"
69
69
  end
70
70
 
71
71
  def filter field, value, operator=nil
@@ -4,7 +4,7 @@ end
4
4
 
5
5
  # lookup fields are often based on cards' compound names
6
6
  event :refresh_lookup, :integrate, changed: :name, on: :update do
7
- lookup.refresh
7
+ lookup ? lookup.refresh : create_lookup
8
8
  end
9
9
 
10
10
  event :delete_lookup, :finalize, on: :delete do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card-mod-lookup
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: '0.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philipp Kühl
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-10-26 00:00:00.000000000 Z
12
+ date: 2021-12-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: card
@@ -62,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  - !ruby/object:Gem::Version
63
63
  version: '0'
64
64
  requirements: []
65
- rubygems_version: 3.2.28
65
+ rubygems_version: 3.2.15
66
66
  signing_key:
67
67
  specification_version: 4
68
68
  summary: lookup