seek_party 0.0.3 → 0.0.4
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/Gemfile.lock +1 -1
- data/README.md +4 -2
- data/lib/seek_party/seek_party_attribute.rb +3 -3
- data/lib/seek_party/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8565511402cda8b89f140b67567ae208e672ff6591220a9506702cd2820b6e3
|
4
|
+
data.tar.gz: 458b43c84c360bd598bbd0fce878a87a6cb3e9b917289ddbbe07ace23ba81ce8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba5f61e2af960ab8332301f40c1d4aac22bcee9463c863068a9ebb05eb3e4cdae925f63a3d1a07694ae8adb1f392143c3d04574c9d368a0eb5c108555f64824f
|
7
|
+
data.tar.gz: 9e04fe9a7d92f9264768db3474fa75847446c80812e59c46276b513bbb7eba656374f5e92120cf57a1fe99a082be8e522eddbebeabaff738f084dd75f3626509
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# SeekParty - Searches made easy
|
2
2
|
|
3
|
+
[](https://travis-ci.org/caws/seek_party)
|
4
|
+
[](https://codeclimate.com/github/caws/seek_party/maintainability)
|
5
|
+
[](https://codeclimate.com/github/caws/seek_party/test_coverage)
|
6
|
+
|
3
7
|
### What is this?
|
4
8
|
|
5
9
|
Have you ever had to write a search functionality for a web application and found yourself
|
@@ -33,8 +37,6 @@ Below is what's currently doable:
|
|
33
37
|
PS: The DEFAULT_BLACK_LIST contains the attributes :id, :created_at and :updated_at. You can pass your own
|
34
38
|
DEFAULT_BLACK_LIST when calling the #search method from your model, but I recommend using the WHITE_LIST,
|
35
39
|
as SeekParty will then only generate queries using the column names present there.
|
36
|
-
You should also keep in mind that when building the queries, seek_party tries to pluralize your table name in order to refer to the table
|
37
|
-
columns by their full name (ex: 'your_table.your_column_name').
|
38
40
|
|
39
41
|
## Getting started
|
40
42
|
|
@@ -23,7 +23,7 @@ module SeekParty
|
|
23
23
|
def check_attributes(another_model)
|
24
24
|
return nil if another_model.nil?
|
25
25
|
|
26
|
-
sp_attribute = SPAttribute.new(table_name:
|
26
|
+
sp_attribute = SPAttribute.new(table_name: get_table_name)
|
27
27
|
|
28
28
|
another_model.attributes.keys.each do |attribute|
|
29
29
|
next unless another_model.has_attribute? attribute
|
@@ -45,8 +45,8 @@ module SeekParty
|
|
45
45
|
@black_list.include? attribute_name
|
46
46
|
end
|
47
47
|
|
48
|
-
def
|
49
|
-
@inspected_class.
|
48
|
+
def get_table_name
|
49
|
+
@inspected_class.table_name.underscore
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
data/lib/seek_party/version.rb
CHANGED