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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b2d7e46586d311e9b1a4450dd75feb25421986f6
4
- data.tar.gz: dcd5eea9619016b46420c5465275d4f033695b41
3
+ metadata.gz: 7ab59e371027d7f29551fa04bfe3da3325057eb6
4
+ data.tar.gz: b89789424747262fecb03ba3ef863132f5dac4d4
5
5
  SHA512:
6
- metadata.gz: 2e2e90bd648bc61d0f94586576770df8a5a6f78fddd2800ea396f1992050744b6d6f931a100ad05492aea968f13c49da1a66e09e442ebacba929f07681131203
7
- data.tar.gz: 97e4c5a95fad8d200764649071a904ad0a1a7a44fa5aed166f646812cd91aa8a53d7df9ea53e6092f3b021fafe228d71e20e553d93aba6a1eec8603a9e1ed192
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: class_name) }
10
- scope :with_method_name, ->(method_name) { where(method_name: 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: class_name) }
13
- scope :with_method_name, ->(method_name) { where(method_name: 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 method</label>
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>
@@ -1,3 +1,3 @@
1
1
  module OkuribitoRails
2
- VERSION = "0.2.2".freeze
2
+ VERSION = "0.2.3".freeze
3
3
  end
Binary file