This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rails_helper' | |
RSpec.describe Processable do | |
before(:all) do | |
Temping.create :processable_model do | |
include Processable | |
with_columns do |t| | |
t.boolean :processable, default: false | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Task < ActiveRecord::Base | |
include Processable | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'active_support/concern' | |
module Processable | |
extend ActiveSupport::Concern | |
included do | |
scope :processed, ->{ where processed: true } | |
scope :unprocessed, ->{ where processed: false } | |
end |
NewerOlder