text
stringlengths
10
2.61M
# frozen_string_literal: true require 'test_helper' module Dealersocket module Client class BaseTest < Minitest::Test def setup use_default_configuration end def test_create_http_request_adds_auth_and_xml_to_header headers = Base.create_http_request(xml_body).default_options.h...
class Book < ApplicationRecord belongs_to :user, optional: true # optional: trueで外部キーのnilを許可できるようになる validates :title, presence: true validates :body, presence: true validates :body, length: { maximum: 200 } def user #インスタンスメソッドないで、selfはインスタンス自身を表す return User.find_by(id: self.user...
class User < ActiveRecord::Base has_one :user_role has_one :role, through: :user_role has_many :user_raids has_many :raids, through: :user_raids # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable and :omniauthable devise :database_authenticatable, :registera...
require File.dirname(__FILE__) + '/../test_helper' require 'registration_controller' # Re-raise errors caught by the controller. class ActiveRbac::RegistrationController; def rescue_action(e) raise e end; end class ActiveRbac::RegistrationControllerTest < Test::Unit::TestCase fixtures :roles, :users, :groups, :role...
module Authentication class Check include Interactor def call user = User.find_by(email: context.email) if user&.authenticate(context.password) context.user = user else context.fail! message: I18n.t('interactors.authentication.check.failure') end end end end
class AddUserAccountFields < ActiveRecord::Migration[6.1] #Adds customer attributes to User def change add_column :users, :first_name, :string add_column :users, :last_name, :string add_column :users, :phone_number, :string end end
require 'test_helper' class AutomaticsControllerTest < ActionController::TestCase setup do @automatic = automatics(:one) end test "should get index" do get :index assert_response :success assert_not_nil assigns(:automatics) end test "should get new" do get :new assert_response :succ...
Rails.application.routes.draw do devise_for :users root to: 'pages#home' get '/about', to: 'pages#about' resources :courses do resources :progresses, only: [:create, :update] resources :comments, only: [:create] resources :exercises, only: [:new, :create] member do get :lecture ...
class Mealbook < ActiveRecord::Base belongs_to :owner, class_name: User, foreign_key: "user_id" has_many :meals has_many :meal_assignments, through: :meals validates :mealbook_name, presence: true end
Rails.application.routes.draw do root 'static_pages#home' get '/signup', to: 'users#new' post '/signup', to: 'users#create' get '/login', to: 'sessions#new' post '/login', to: 'sessions#create' delete '/logout', to: 'sessions#destroy' resources :categories do resources :comics end res...
# frozen_string_literal: true require 'test_helper' module Vedeu module Models describe Page do let(:described) { Vedeu::Models::Page } let(:instance) { described.new(rows) } let(:rows) { [ [:hydrogen, :helium, :lithium], [:beryllium, :boron, :carbon], ...
# Variables and Names # Assign values to variables with equals = cars = 100 # Floating point number for accurate, non-rounding answers space_in_car = 4.0 drivers = 30 passengers = 90 # Variables are written with underscores cars_not_driven = cars - drivers # A variable can be assigned as a value for another variable c...
#! /usr/bin/env ruby # Courtesy of https://gist.github.com/mbland/3812259 and altered to allow nils. require_relative 'mixins.rb' class NilSortingArray < Array # sort_by with nils going at the end. def sort_by_with_nil!(meth=:to_s) # Break the collection into items that evaluate to nil and those that don't ...
require 'test_helper' require 'file_upload_cache/engine.rb' class UploaderInputTest < ActionController::TestCase # Include what is needed to actually make test calls to semantic form for include Formtastic::Helpers::FormHelper include ActionView::Helpers::FormHelper include ActionView::Context include Action...
require 'spec_helper' provider_class = Puppet::Type.type(:nexus_repository).provider(:ruby) describe provider_class do before(:each) do Nexus::Config.stub(:resolve).and_return('http://example.com/foobar') Nexus::Config.stub(:can_delete_repositories).and_return(true) end let :provider do resource = ...
require "yaml" class UserMailer < ActionMailer::Base class << self attr_accessor :subdomain end # ================= # Sign up and upgrade # 1) sign up notification # 2) your new billing plan # # ================= def confirm_upgrade(user, account) setup_email(user) @subject += I...
# frozen_string_literal: true FactoryBot.define do factory :person, class: 'Vet360::Models::Person' do addresses [FactoryBot.build(:vet360_address), FactoryBot.build(:vet360_address, :mailing)] emails [FactoryBot.build(:email)] # TODO: the telephone factory will not register?? # telephones [F...
class Subordinate < ActiveRecord::Base unloadable belongs_to :planning_manager belongs_to :principal validates_uniqueness_of :principal_id, :scope => [:planning_manager_id] end
## # Send a breaking news mobile notification # module Job class SendBreakingNewsMobileNotification < Base @queue = "#{namespace}:breaking_news_email" class << self def perform(id) @alert = BreakingNewsAlert.find(id) @alert.publish_mobile_notification end end end end
class CreateFeedItems < ActiveRecord::Migration[5.0] class MigrateFeedItem < ActiveRecord::Base self.table_name = :feed_items belongs_to :feedable, polymorphic: true end class MigrateTweetReview < ActiveRecord::Base self.table_name = :tweet_reviews end class MigrateTweet < ActiveRecord::Base ...
class CreateMonitorings < ActiveRecord::Migration[6.0] def change create_table :monitorings do |t| t.references :class_monitor, null: false, foreign_key: true t.text :question t.string :place t.text :excuse t.timestamp :date_time t.timestamps end end end
module TaskHelper def format_reschedule task_id html = '-' icon = raw content_tag(:i, '', class: "glyphicon glyphicon-calendar") html = raw content_tag(:a, raw(icon), class: 'task-reschedule', href: 'javascript:void(0)', task_id: task_id) html end def format_checkbox task html = '-' htm...
module CommonAttributes module OfferCapCents extend ActiveSupport::Concern MIN_OFFER_CAP = 0 MAX_OFFER_CAP = 1000 included do money :offer_cap, :cents => :offer_cap_cents validates :offer_cap_cents, numericality: { integer_only: true, greater_than_or_equal_to: ...
module ApplicationHelper def gravatar_for(user, options = { size: 80 }) email_hash = Digest::MD5.hexdigest(user.email.downcase) size = options[:size] url = "https://secure.gravatar.com/avatar/#{ email_hash }?s=#{size}" image_tag(url, alt: user.username, class: "img-circle img-responsive") end end...
#!/usr/bin/env ruby #bundle exec /app/forex-economic-data-site/lib/tasks/recurring_tasks.rb puts 'start!!!!!!!!' ENV['RAILS_ENV'] ||= 'production' ENV['RAILS_ENV'] = "#{ENV['RAILS_ENV']}_scraper" exit! unless %w(production_scraper development_scraper) .include? ENV['RAILS_ENV'] puts 'ark!!!!!!!!' re...
class Rating < ApplicationRecord belongs_to :user belongs_to :rateable, polymorphic: true end
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'gem_bench/version' Gem::Specification.new do |spec| spec.name = "gem_bench" spec.version = GemBench::VERSION spec.authors = ["Peter Boling"] spec.email = ["pe...
module Seed::ComponentTypes components = { tire: { name: 'Tire' }, engine: { name: 'Engine' }, windshield: { name: 'Windshield' } } @@components = {} components.each do |key, params| @@components[key] = ComponentType.find_or_create_by(params) end def self.get(key) @@components[k...
require 'spec_helper' describe RoomsController do render_views describe '#index' do let!(:room) { create(:room, active: true) } let(:call_request) { get :index } context 'after request' do before { call_request } it { expect(assigns(:rooms)).to eq [room] } it { should render_templa...
class CreateProducts < ActiveRecord::Migration[5.2] def change create_table :products do |t| t.string :name t.text :introduction t.string :image_id t.integer :maker_id t.date :release_date t.float :rate t.boolean :is_lens, default: FALSE t.boolean :is_sales, defaul...
# frozen_string_literal: true module Decidim module Opinions # Exposes the opinion vote resource so users can vote opinions. class OpinionVotesController < Decidim::Opinions::ApplicationController include OpinionVotesHelper include Rectify::ControllerHelpers helper_method :opinion b...
require 'spec_helper' RSpec.describe ShopifyImport::Creators::BaseCreator, type: :service do let(:shopify_data_feed) { create(:shopify_data_feed) } subject { described_class.new(shopify_data_feed) } describe '#save!' do it 'raises not implemented error' do expect { subject.save! }.to raise_error NotIm...
#1 require "pry" def interleave(arr_1, arr_2) result = [] arr_1.each_with_index do |element, index| result << element << arr_2[index] end result end interleave([1, 2, 3], ['a', 'b', 'c']) == [1, 'a', 2, 'b', 3, 'c'] def interleave_with_zip(arr_1, arr_2) arr_1.zip(arr_2).flatten end p interleave_wit...
class User < ApplicationRecord devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :omniauthable, omniauth_providers: [:facebook, :developer] has_many :characters, inverse_of: :user has_many :downstream_referrals, class_name: 'Referral', ...
namespace :db do namespace :seed do desc "Regenerate seeds" task regenerate: :environment do require 'database_cleaner' DatabaseCleaner.strategy = :truncation DatabaseCleaner.clean Rake::Task["db:seed"].invoke end end end
require 'test_helper' class CharityEmailsControllerTest < ActionController::TestCase setup do @charity_email = charity_emails(:one) end test "should get index" do get :index assert_response :success assert_not_nil assigns(:charity_emails) end test "should get new" do get :new assert...
FactoryGirl.define do factory :subject do title { Faker::Lorem.sentence(10) } writer { create(:writer) } room { create(:room) } end end
class PostsController < ApplicationController def index @post = Post.order(created_at: :desc).last(32) end def new @post = Post.new end def create post_params = params.require(:post,:category).permit([:title,:body,:name]) @post = Post.new post_params end def show @post = Post.find para...
class FontTexGyreCursor < Formula version "2.004" sha256 "ae8db1c134ec5c1b8c3999116b0610a5ad1c6f47520c3b4712b9bc914458dce9" url "http://www.gust.org.pl/projects/e-foundry/tex-gyre/cursor/qcr#{version}otf.zip" desc "TeX Gyre Cursor" homepage "http://www.gust.org.pl/projects/e-foundry/tex-gyre/cursor" def ins...
module Exceptions class CartError < StandardError; end end
class Supplier < ActiveRecord::Base acts_as_gmappable def gmaps4rails_address "#{address}, #{city}" end attr_accessible :address, :category, :city, :latitude, :longitude, :name, :phone, :email validates :address, presence: true validates :category, presence: true validates :city, presence: true valid...
# frozen_string_literal: true class UniformNotifier VERSION = '1.16.0' end
require File.dirname(__FILE__) + '/../../spec_helper' describe 'SimpleDB.delete_domain' do before(:all) do @sdb = Fog::AWS::SimpleDB.gen @domain_name = "fog_domain_#{Time.now.to_i}" end before(:all) do @sdb.create_domain(@domain_name) end it 'should return proper attributes' do actual = @s...
require 'spec_helper' describe 'Ita Taxonomy API V2', type: :request do include_context 'V2 headers' before(:all) do ItaTaxonomy.recreate_index ItaTaxonomyData.new("#{Rails.root}/spec/fixtures/ita_taxonomies/test_data.zip").import end let(:search_path) { '/v2/ita_taxonomies/search' } let(:expected_...
class AddCommentsCountToDailyReports < ActiveRecord::Migration[5.0] def change add_column :daily_reports, :comments_count, :integer, limit: 3 end end
require_relative 'spec_helper' describe 'fivem::vrp_basic_mission' do let(:subject) do ChefSpec::SoloRunner.new do |node| node.override['fivem']['prefix'] = '/server' node.override['fivem']['vrp_bm']['repository'] = 'https://my/host/vrp-basic-mission.git' node.override['fivem']['vrp_bm']['refer...
Rails.application.routes.draw do resources :items do resources :orders, shallow: true end # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html end
# frozen_string_literal: true class PostSerializer < ActiveModel::Serializer attributes :id, :stars, :weekday, :active?, :created_at has_one :image has_one :message has_one :report end
# -*- encoding : utf-8 -*- class ExtendApps < ActiveRecord::Migration def up change_table :client_applications do |t| t.string :icon_16 t.string :icon_64 t.string :description t.string :author t.string :author_url end end def down remove_column :client_applications, :icon_16 remove_column :cl...
class VenueUsersController < ApplicationController before_action :set_venue_user, only: [:show, :edit, :update, :destroy] # GET /venue_users # GET /venue_users.json def index @venue_users = VenueUser.all end # GET /venue_users/1 # GET /venue_users/1.json def show @venue_user = VenueUser.find(p...
class OrderService < OrderItem acts_as_paranoid recover_dependent_associations: true validates :item, absence: true validates :discount, absence: true validates :count, absence: true validates :final_price, presence: true validates :description, presence: true end
# frozen_string_literal: true module Vedeu module Editor # Manipulate the lines of an Vedeu::Editor::Document. # # @api private # class Delete include Vedeu::Common # @param (see #initialize) # @return [Vedeu::Editor::Line|Vedeu::Editor::Lines] def self.from(collection...
class RenameBlogsTableToPosts < ActiveRecord::Migration def change rename_table('blogs', 'posts') end end
class SessionsController < ApplicationController skip_before_action :authenticate_user def create instagram = InstagramService.new session[:token] = instagram.authenticate(ENV['instagram_client_id'], ENV['instagram_client_secret'], params[:code]) redirect_to root_path end end
describe Checkr::Report do before do VCR.insert_cassette name end after do VCR.eject_cassette end describe '.create' do let(:report) { Checkr::Report.create(:package => 'driver_plus', :candidate_id => 'e44aa283528e6fde7d542194')} it "should create report" do report.must_be_instance_of...
# == Schema Information # # Table name: contacts # # created_at :datetime not null # email :string(255) # how :string(255) # id :integer not null, primary key # message :text # name :string(255) # updated_at :datetime not null # class Contact < ActiveRecord:...
require 'rubygems' require 'cwiid' require 'ostruct' wiimote = WiiMote.new wiimote.rpt_mode = WiiMote::RPT_BTN | WiiMote::RPT_ACC @opts=OpenStruct.new @opts.output_mode = :dec #:graph @opts.graph_scale = 4 # length = (255/graph_scale).to_i @opts.acc_range = 1 @opts.state = :active def get_acc(wiimote) wiimote.ac...
class CreateWeeklyRates < ActiveRecord::Migration[5.0] def change create_table :weekly_rates do |t| t.date :rate_date t.float :rate t.timestamps end add_reference :weekly_rates, :base_currency, references: :currencies, index: true add_reference :weekly_rates, :target_currency, refere...
class RenameOauthExpirationInUsers < ActiveRecord::Migration def change rename_column("users", "oauth_expires_at", "oauth_expiry") end end
class ProfileMedicationsController < InheritedResources::Base private def profile_medication_params params.require(:profile_medication).permit(:profile_id, :medication_id, :startDate, :endDate, :count, :unit, :dose, :unit, :frequency, :taken) end end
require "rails_helper" RSpec.feature "User can edit an artist information" do scenario "able to update artist info" do artist = Artist.create(name: "Alec Tronic", image_path: "http://anotherwhiskyformisterbukowski.com/wp-content/uploads/2013/06/artworks-000049472137-fb15gh-t500x500.jpg") updated_name = "Ale...
require 'rails_helper' describe SearchController do include SearchSupporter describe 'GET #index' do it "renders the index" do get :index expect(response).to render_template("index") end it "resets the page number" do get :index expect(session[:page]).to be(0) end it ...
json.array!(@native_languages) do |native_language| json.extract! native_language, :id, :name json.url native_language_url(native_language, format: :json) end
module GemConfig class Rules < Hash def has(key, attrs = {}) check_attributes attrs self[key.to_sym] = attrs end def check(key, value) error_message = case when !self.has_key?(key.to_sym) 'no rule found' when self[key.to_sym].has_key?(:classes) && Array(self[key.to_s...
require 'spec_helper' describe "patients/index.html.erb" do before(:each) do assign(:patients, [ stub_model(Patient, :current_state => "Current State", :encrypted_nhs_number => "Encrypted Nhs Number", :encrypted_initials => "Encrypted Initials", :encrypted_postcode => "Encry...
# frozen_string_literal: true module MideaAirCondition # This is where we build our packets class PacketBuilder def initialize(security) @security = security @command = [] populate_header_data # Maybe this one is the client id # In a response it's the device id # and the f...
class AddThemeNameToWebsite < ActiveRecord::Migration[5.0] def change add_column :websites, :theme, :string, index: true add_index "websites", ["theme"], name: "index_websites_on_theme", using: :btree add_index "websites", ["name"], name: "index_websites_on_name", using: :btree add_index "websites", [...
# -*- encoding: utf-8 -*- require File.expand_path('../lib/authority/version', __FILE__) Gem::Specification.new do |gem| gem.license = 'MIT' gem.authors = ["Nathan Long", "Adam Hunter"] gem.email = ["nathanmlong@gmail.com", "adamhunter@me.com"] gem.summary = %q{Authority helps you aut...
class ChangeMaterialsToMaterial < ActiveRecord::Migration[5.1] def change rename_column :boxes, :materials, :material end end
require File.expand_path('../../helper.rb', File.dirname(__FILE__)) describe VirtualBox::Vm::Board do describe 'os_types' do before do @types = VirtualBox::Vm::Board.os_types end it 'maps linux 2.6' do @types.must_include :linux26 end it 'includes linux 2.6 ID' do @types.m...
class VoteLog < ActiveRecord::Base belongs_to :user belongs_to :voucher, class_name: 'User' belongs_to :participation validates :user, presence: true validates :participation, presence: true validates :user_id, uniqueness: { scope: :participation_id } end
class Rixel::Image::Label include Mongoid::Document VALID_FIELDS = [:text, :font, :size, :pos, :color, :border_color, :border_size] # The label text. field :text, type: String # The font. field :font, type: String # Font size. field :size, type: Integer # Position, which in IM terms is 'gravity' ...
maintainer "Philip (flip) Kromer - Infochimps, Inc" maintainer_email "coders@infochimps.com" license "Apache 2.0" long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version "3.1.0" description "OSX Workstation packages" depends "install_from" depends ...
json.array!(@tops) do |top| json.extract! top, :id json.url top_url(top, format: :json) end
Sequel.migration do change do create_table :branch_meetings do primary_key :id foreign_key :branch, :branches String :datetime String :location String :notes end create_table :branch_meeting_attendance_records do primary_key :id foreign_key :meeting, :branch_mee...
require 'spec_helper' describe Package do describe 'Associations' do it { should belong_to :branch } it { should belong_to :srpm } it { should belong_to :group } it { should have_many :provides } it { should have_many :requires } it { should have_many :obsoletes } it { should have_many :...
# == Schema Information # # Table name: borrowingcards # # id :integer not null, primary key # borrower_id :integer # book_id :integer # created_at :datetime not null # updated_at :datetime not null # class Borrowingcard < ApplicationRecord belongs_to :borrower, :c...
module Brewery class AuthCore::UserSession < Authlogic::Session::Base logout_on_timeout true disable_magic_states true httponly true validate :is_user_blocked? private def is_user_blocked? if attempted_record && attempted_record.blocked? errors[:base] << I18n.t('active_re...
module Fog module Parsers module Bluebox class GetImages < Fog::Parsers::Base def reset @template = {} @response = { 'images' => [] } end def end_element(name) case name when 'public' @template[name] = @value when 'id' ...
class IntegratorTask include Delayed::RecurringJob run_every 4.minutes queue 'intg-jobs' require_relative '../services/sync_service' def perform s = SyncService.new s.sync_reservations_and_update_availability end end
task :default => :commit # We may be running under RVM, so define a way to check def maglev_using_rvm ENV['rvm_path'] != "" && (/^maglev/ =~ ENV['rvm_ruby_string']) == 0 end ENV['MAGLEV_OPTS'] = '-Ilib' desc "Commit the MDB Server code to the repository." task :commit do sh 'maglev-ruby commit_code.rb' end des...
class SessionsController < ApplicationController #GET /sign_in def new redirect_to home_path if logged_in? end # POST /sign_in def create user = User.find_by(email: params[:email]) if user && user.authenticate(params[:password]) session[:user_id] = user.id flash[:success] = "You've...
class FrontendController < ApplicationController before_filter :load_categories private def load_categories @categories = Category.roots end end
# frozen_string_literal: true # rspec ./spec/lib/statistic_calcs/inference/standard_deviation_spec.rb require 'statistic_calcs/inference/standard_deviation' # rubocop:disable BlockLength RSpec.describe StatisticCalcs::Inference::StandardDeviation do subject { StatisticCalcs::Inference::StandardDeviation.new(options...
class User < ActiveRecord::Base has_many :purchases has_many :items, foreign_key: :listed_by end
require 'landlord/tenant' module Landlord module Migrator extend self def migrations_paths [Rails.root.join('db', 'landlord', 'migrate')] end def create_tenant_schema_migrations_table(database) table_name = "#{database}.#{ActiveRecord::SchemaMigration.table_name}" index_name = "#...
class TicketMessage < ApplicationRecord tracked resourcify belongs_to :ticket belongs_to :created_by, class_name: "Person" belongs_to :parent, class_name: "TicketMessage", required: false end
class MessagesController < ApplicationController def create message = Message.new(message_params) message.user = current_user if message.save #broadcasting out to messages channel including the chat_id so messages are broadcasted to specific chat only ActionCable.server.broadcast( "messages_#{message...
def count_strings(array) array.count do |element| element.is_a? String end end def count_empty_strings(array) array.count do |element| element == "" end end # require "pry" # def count_strings(array) # # Return the total number of strings in the provided array using the count enumerable # tota...
class AddColumunsToEmptyClients < ActiveRecord::Migration[5.1] def change add_column :clients, :name, :string, null: false add_column :clients, :phone, :string, null: false add_column :clients, :address, :string, null: false end end
class UserMailer < ApplicationMailer def welcome_alpha_email(user) @subject = "You've been approved for Kafki!" @user = user @url = account_confirm_url :email => user.email, :x => Email.email_hash(user.email) send_mail end def confirm_email(user, email) @subject = "Please confirm your email"...
class CreateSubCategory < ActiveRecord::Migration def self.up create_table :sub_categories do |t| t.string :name t.references :category t.boolean :is_active, :default => true t.boolean :is_available, :default => false t.boolean :deleted, :default => false t.timestamps end e...
# frozen_string_literal: true module RubyLink VERSION = "0.1.0" end
# -*- encoding : utf-8 -*- module ::IdentifiesAs @identities = { } @instance_identities = { } @do_not_identify_as = { } @instances_do_not_identify_as = { } ########################## # self.append_features # ########################## def self.append_features( instance ) instance.ext...
require_relative '../lib/townhall.rb' describe "the townhall_scrapper" do townhall = hash_name_mail it "should return an array" do expect(townhall.kind_of?(Array)).to eq true end it "should be composed of hash" do expect(townhall.all? {|i| i.is_a?(Hash)}).to eq true end it "sh...
# Provide a simple gemspec so you can easily use your enginex # project in your rails apps through git. Gem::Specification.new do |s| s.add_development_dependency("mocha") s.add_development_dependency("pg", "~> 0.10.0") s.add_runtime_dependency("activerecord", "~> 3.0.8") s.name = "detached_counter_cache" s.s...
#!/usr/bin/env ruby require 'fileutils' HOME = ENV['HOME'] NODE = `hostname`.split.first KBEST = "#{HOME}/projects/beast/blotter/kbest.rb" TEST_ROOT = "#{HOME}/projects/msc-thesis/tests/ppm-rr/scalability" THREADS = [1, 2, 4, 6, 8, 12, 16, 24, 32] PPI = [19, 20, 21, 22] EXEC = "#{{}}" THREADS.eac...
=begin Test de la class TI (Tests Intégration) =end require 'spec_helper' describe TI do describe "Dossier courant de test" do describe "Définition ONLINE/OFFLINE" do before(:each) do @old_value_is_online = cv_get(TI, :is_online) end after(:each) do cv_set(TI, :is_online => @old_value_is_onl...
CloudFormation do S3_Bucket(:Bucket) do end S3_Bucket(:c1NamedBucket) do BucketName FnFindInMap('bucketnames', 'default', 'name') end Output(:c1OutParam) do Value(Ref(:Bucket)) end end
module Recipes class RecipeRepository include FileRepository self.directory = File.join(Application.root, 'content', 'recipes') self.file_extensions = %w[yaml yml] self.entity_class = Recipes::Recipe def self.valid_conditions super|[:category] end end end