arable 0.1.0 → 0.1.5
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/README.md +1 -1
- data/arable-0.1.0.gem +0 -0
- data/lib/arable/version.rb +1 -1
- data/lib/arable.rb +13 -12
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e759cee16589d2e4a6938fa4fdd8299e7265212cd9eab8313fd5bd8bf8b22836
|
|
4
|
+
data.tar.gz: 20609ecbdca2c5c47b858d7d041a10e51f0c3c6a90fc447e25132e54c419175d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d0d31fceda28bfc71b997b27ef8de06965e4663b0b25e913aecea6467347161540877090f4b54633f7ced28e7110be493c13ba70a30166d452c2d40e80ddaa2a
|
|
7
|
+
data.tar.gz: 8a662ef630e48b470c6057575fc83c967aedfaa46544f470eacab9e667d5ab4ce8b778cdc3fccd5f3000fd0a50f4f184be3b260d21b265ec2700b79e66c3ee13
|
data/README.md
CHANGED
|
@@ -32,7 +32,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
|
32
32
|
|
|
33
33
|
## Contributing
|
|
34
34
|
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/dvisockas/arable.
|
|
36
36
|
|
|
37
37
|
## License
|
|
38
38
|
|
data/arable-0.1.0.gem
ADDED
|
Binary file
|
data/lib/arable/version.rb
CHANGED
data/lib/arable.rb
CHANGED
|
@@ -8,7 +8,9 @@ module Arable
|
|
|
8
8
|
SKIP_ARABLE_COLUMNS_CLASS_VAR_NAME = :@@skip_arable_columns
|
|
9
9
|
|
|
10
10
|
def self.models
|
|
11
|
-
ApplicationRecord
|
|
11
|
+
ApplicationRecord
|
|
12
|
+
.models
|
|
13
|
+
.reject { |model| model.class_variable_defined?(SKIP_ARABLE_COLUMNS_CLASS_VAR_NAME) }
|
|
12
14
|
end
|
|
13
15
|
|
|
14
16
|
def self.column_names_from_schema(table_name)
|
|
@@ -56,20 +58,19 @@ module Arable
|
|
|
56
58
|
arel_table[Arel.star]
|
|
57
59
|
end
|
|
58
60
|
end
|
|
59
|
-
end
|
|
60
61
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
module ActiveRecordExtension
|
|
63
|
+
def inherited(subclass)
|
|
64
|
+
super
|
|
64
65
|
|
|
65
|
-
|
|
66
|
+
subclass.extend(Arable::ClassMethods)
|
|
66
67
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
# include Arable only when the class has finished defining itself
|
|
69
|
+
TracePoint.trace(:end) do |trace|
|
|
70
|
+
if subclass == trace.self
|
|
71
|
+
subclass.include(Arable)
|
|
72
|
+
trace.disable
|
|
73
|
+
end
|
|
73
74
|
end
|
|
74
75
|
end
|
|
75
76
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: arable
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Danielius Visockas
|
|
@@ -26,6 +26,7 @@ files:
|
|
|
26
26
|
- LICENSE.txt
|
|
27
27
|
- README.md
|
|
28
28
|
- Rakefile
|
|
29
|
+
- arable-0.1.0.gem
|
|
29
30
|
- lib/arable.rb
|
|
30
31
|
- lib/arable/version.rb
|
|
31
32
|
- sig/arable.rbs
|