okuribito_rails 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/okuribito_rails/method_call_situations_controller.rb +1 -1
- data/app/models/okuribito_rails/method_call_log.rb +2 -2
- data/app/models/okuribito_rails/method_call_situation.rb +4 -2
- data/app/views/okuribito_rails/method_call_situations/index.html.erb +5 -1
- data/lib/okuribito_rails/version.rb +1 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +7294 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/4F/4f1eR4_104njcnSeaN-fDwQeGvD8oU-IOYW7hlg9pCU.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/o4/o4Dtt7dDuWRq_d6dTGBhjQkPvD806ndWV6icJQmipyw.cache +2 -0
- data/spec/features/method_call_logs_page_spec.rb +14 -0
- data/spec/features/method_call_situations_page_spec.rb +30 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ab59e371027d7f29551fa04bfe3da3325057eb6
|
4
|
+
data.tar.gz: b89789424747262fecb03ba3ef863132f5dac4d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dae11f8dd5f4a26d8e311f2c328c2f71d2cc7e46cfd105d43add8b1a2dd5099b9722a1b2715ef9b641a5450e626bca5d4690067c801a04e5f04058e70565f3c8
|
7
|
+
data.tar.gz: c384faa49d4613329831f3c0e4b756162d9b3ac3ac4e009e6c456c044f193dc97b8283ef4d6951c6d5a892b5b2e68d540203540edc76ff0f498ff873d2d4847c
|
@@ -12,7 +12,7 @@ module OkuribitoRails
|
|
12
12
|
private
|
13
13
|
|
14
14
|
def method_call_situation_params
|
15
|
-
params.permit(:class_name, :method_name, :x_days_passed, :uncalled_method)
|
15
|
+
params.permit(:class_name, :method_name, :x_days_passed, :uncalled_method, :called_method)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
@@ -6,8 +6,8 @@ module OkuribitoRails
|
|
6
6
|
validates :method_symbol, presence: true, inclusion: { in: %w(. #) }
|
7
7
|
validates :method_name, presence: true, length: { minimum: 1, maximum: 255 }
|
8
8
|
|
9
|
-
scope :with_class_name, ->(class_name) { where(class_name
|
10
|
-
scope :with_method_name, ->(method_name) { where(method_name
|
9
|
+
scope :with_class_name, ->(class_name) { where("class_name LIKE ?", "%#{class_name}%") }
|
10
|
+
scope :with_method_name, ->(method_name) { where("method_name LIKE ?", "%#{method_name}%") }
|
11
11
|
|
12
12
|
def self.search(args)
|
13
13
|
mcl = self
|
@@ -9,11 +9,12 @@ module OkuribitoRails
|
|
9
9
|
presence: true,
|
10
10
|
numericality: { only_integer: true, less_than_or_equal_to: 9_999 }
|
11
11
|
|
12
|
-
scope :with_class_name, ->(class_name) { where(class_name
|
13
|
-
scope :with_method_name, ->(method_name) { where(method_name
|
12
|
+
scope :with_class_name, ->(class_name) { where("class_name LIKE ?", "%#{class_name}%") }
|
13
|
+
scope :with_method_name, ->(method_name) { where("method_name LIKE ?", "%#{method_name}%") }
|
14
14
|
scope :with_days_passed,
|
15
15
|
->(num) { where("created_at <= ?", Time.zone.today.days_ago(num).end_of_day) }
|
16
16
|
scope :with_uncalled_method, -> { where(called_num: 0) }
|
17
|
+
scope :with_called_method, -> { where(called_num: 1..Float::INFINITY) }
|
17
18
|
|
18
19
|
def self.search(args)
|
19
20
|
mcs = self
|
@@ -21,6 +22,7 @@ module OkuribitoRails
|
|
21
22
|
mcs = mcs.with_method_name(args[:method_name]) if args[:method_name].present?
|
22
23
|
mcs = mcs.with_days_passed(args[:x_days_passed].to_i) if args[:x_days_passed].present?
|
23
24
|
mcs = mcs.with_uncalled_method if args[:uncalled_method].present?
|
25
|
+
mcs = mcs.with_called_method if args[:called_method].present?
|
24
26
|
mcs
|
25
27
|
end
|
26
28
|
end
|
@@ -14,9 +14,13 @@
|
|
14
14
|
<%= number_field_tag :x_days_passed, params[:x_days_passed], placeholder: 0 %>
|
15
15
|
</dt>
|
16
16
|
<dt>
|
17
|
-
<label>Uncalled
|
17
|
+
<label>Uncalled</label>
|
18
18
|
<%= check_box_tag :uncalled_method, true, params[:uncalled_method] %>
|
19
19
|
</dt>
|
20
|
+
<dt>
|
21
|
+
<label>Called</label>
|
22
|
+
<%= check_box_tag :called_method, true, params[:called_method] %>
|
23
|
+
</dt>
|
20
24
|
<dd>
|
21
25
|
<button>Search</button>
|
22
26
|
</dd>
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|