Class: UiChanged::ScreenshotIgnoreUrlsController
- Inherits:
-
ScreenshotsControllerBase
- Object
- ActionController::Base
- ApplicationController
- ScreenshotsControllerBase
- UiChanged::ScreenshotIgnoreUrlsController
- Defined in:
- app/controllers/ui_changed/screenshot_ignore_urls_controller.rb
Instance Method Summary collapse
- #add ⇒ Object
- #add_all_compares ⇒ Object
- #add_all_controls ⇒ Object
- #add_all_tests ⇒ Object
- #destroy ⇒ Object
- #destroy_all ⇒ Object
- #index ⇒ Object
Methods inherited from ScreenshotsControllerBase
Instance Method Details
#add ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'app/controllers/ui_changed/screenshot_ignore_urls_controller.rb', line 13 def add ids = params[:id].split(",") ids.each do |id| ss = UiChanged::Screenshot.find(id) ss_ignore = UiChanged::ScreenshotIgnoreUrl.find_or_create_by_url(ss.url) ss_ignore.save end head :ok end |
#add_all_compares ⇒ Object
39 40 41 42 43 44 45 |
# File 'app/controllers/ui_changed/screenshot_ignore_urls_controller.rb', line 39 def add_all_compares UiChanged::Screenshot.not_in_ignored.where(:is_compare => true).each do |screenshot| ss_ignore = UiChanged::ScreenshotIgnoreUrl.find_or_create_by_url(screenshot.url) ss_ignore.save end head :ok end |
#add_all_controls ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'app/controllers/ui_changed/screenshot_ignore_urls_controller.rb', line 23 def add_all_controls screenshots = UiChanged::Screenshot.not_in_ignored.where(:is_control => true) screenshots.each do |screenshot| ss_ignore = UiChanged::ScreenshotIgnoreUrl.find_or_create_by_url(screenshot.url) ss_ignore.save end head :ok end |
#add_all_tests ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'app/controllers/ui_changed/screenshot_ignore_urls_controller.rb', line 31 def add_all_tests screenshots = UiChanged::Screenshot.not_in_ignored.where(:is_test => true) screenshots.each do |screenshot| ss_ignore = UiChanged::ScreenshotIgnoreUrl.find_or_create_by_url(screenshot.url) ss_ignore.save end head :ok end |
#destroy ⇒ Object
47 48 49 50 51 52 53 54 |
# File 'app/controllers/ui_changed/screenshot_ignore_urls_controller.rb', line 47 def destroy ids = params[:id].split(",") ids.each do |id| ss_ignore = UiChanged::ScreenshotIgnoreUrl.find(id) ss_ignore.destroy end head :ok end |
#destroy_all ⇒ Object
55 56 57 58 |
# File 'app/controllers/ui_changed/screenshot_ignore_urls_controller.rb', line 55 def destroy_all UiChanged::ScreenshotIgnoreUrl.delete_all head :ok end |
#index ⇒ Object
6 7 8 9 10 11 |
# File 'app/controllers/ui_changed/screenshot_ignore_urls_controller.rb', line 6 def index params[:sort] ||= "url asc" @ignored_urls = UiChanged::ScreenshotIgnoreUrl.search(params[:search]).paginate(:page => params[:page], :per_page => params[:per_page], :order => params[:sort]) end |