ar_virtual_field 0.6.0 → 0.7.0

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: ffc1272f024fe7a86c06dbe98014598a79749c0e3f0b3f73aabc1abc93371e1a
4
- data.tar.gz: 53662047fab832aafbcba2c18852bdea1938c27d79544a2346f0b242ef822cc0
3
+ metadata.gz: 8c391b47a216fd9d3f4d88fded8000f516eb80cf8bcec72261ae11aba4db36da
4
+ data.tar.gz: b2c66124f49c5ab41911619a6bb035dda7654c221b8968bbba37625ad0137351
5
5
  SHA512:
6
- metadata.gz: 195918203bffe10d882d03a950b8b89181b5cfdcebdbe700838883f006750c56fdd47c46b3ec184ea4a69155d70c0b2e49c367591e2027294bdaddfa856a9a78
7
- data.tar.gz: 89de4af73dc65462a02fd4dc966fe518373c11b23b0dc2e21e6e1979932123868dcd65afbe55ea9d8cb434db6e85495444fe9b4490cfa9665411e26c857c06cd
6
+ metadata.gz: e7ff29785eeef3a6b1b1b77f7711fe0fb776304d7ab7e6f7b70028cd07f7be8d81a1b6b289c82a7be3ac852c4e41baea0cbe6f1be58a2e9ff68e1a9bde7a672a
7
+ data.tar.gz: fd45c9a488e01424d808e6b16647419eb74dc5a3094159ccce1992745f94bf03723da47849a6abe8d9bb851304d3e50949bfcbc42fe3957cbe0c2a72cd9ccb42
data/README.md CHANGED
@@ -63,6 +63,9 @@ user.fullname # => value computed by database
63
63
  User.with_total_orders.where(ArVirtualField[:total_orders] => 5)
64
64
  ```
65
65
 
66
+ > [!WARNING]
67
+ > `ArVirtualField[]` doesn't sanitize its value itself, this example relies on `#where` sanitation, use with caution
68
+
66
69
  This will include the total_orders virtual field in the SQL query and allow filtering by it.
67
70
 
68
71
  ## Contributing
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ArVirtualField
4
- VERSION = "0.6.0"
4
+ VERSION = "0.7.0"
5
5
  end
@@ -13,15 +13,11 @@ module ArVirtualField
13
13
  end
14
14
 
15
15
  def self.table_name(name)
16
- sanitize_table_name("#{name}_outer")
16
+ "#{name}_outer"
17
17
  end
18
18
 
19
19
  def self.table_with_column(name)
20
- sanitize_table_name("#{name}_outer.#{name}")
21
- end
22
-
23
- def self.sanitize_table_name(table)
24
- ActiveRecord::Base.connection.quote_table_name(table)
20
+ "#{name}_outer.#{name}"
25
21
  end
26
22
  end
27
23
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ar_virtual_field
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Egorov