...power that specifies which deals and documents are accessible by a user: class Power include Consul::Power power :deals do Deal.where(author_id: user.id) end power :documents do admin? ? Document.all...

makandra dev
relishapp.com

...in an error like does not implement: current_power. The documentation on dynamic classes includes some ways to fix this by showing how dynamically defined attribute methods from ActiveRecord are...

...then((latitude) => { done(latitude) }) JS expect(returned_latitude).to eq latitude end When we include this step into a scenario and run it, it will fail because StreetMap is not...

getbootstrap.com

...BS 2+3, but not above there are some forks which say that they include a BS4 renderer, but they didn't work for me. Suggestion: Remove simple-navigation and...

...or overwrite the styles by using bootstrap variables. Upgrade Phase 1 First you should include the new version into your project and replace the old imports, e.g. with webpack

makandra dev
api.rubyonrails.org

Rails includes a way to see what an e-mail will look like. Integration to RSpec All you need to do is implement a preview-class in spec/mailers/previews/notifier_preview.rb: class NotifierPreview...

...config/application.rb config.action_controller.include_all_helpers = true If you cannot use this setting, your spec can include individual helper modules like this: describe 'some view', type: :view do helper SomeHelper helper OtherHelper...

render 'view_that_uses_helpers' end end Alternatively you can also explicitly include all helpers of a given controller like this: describe 'some view', type: :view do

...application must do one thing by itself: When sending HTML e-mails, you should include a plain-text body or tools like SpamAssassin will apply a significant score penalty. Here...

...README. Most likely you want: to add the Ruby, Rails and RSpec cops to include the unit test 2. Report all existing offenses and exclude them initially

...auto-gen-config to create a file that excludes all current violations. Your tests (including the Rubocop spec) should now all be green. Commit theses changes and consider whether you...

...with many built-in functions to manipulate color. Some of the more interesting functions include: adjust-hue($color, $degrees) Changes the hue of a color. lighten($color, $amount)

...flag trait from the card above, you can drop the does_flag trait the includes in all your models Note that the following code from the does_flag trait is...

...using a callback. before_initialize :set_newsletter private def set_newsletter return unless [nil, ''].include?(receive_newsletter) self.receive_newsletter = (user.role == 'customer') end Note: When using active_type, the attribute method...

...path with e.g. url_for (excluding :host and similar). Note that it does not include query parameters. Use params.to_unsafe_h returns a HashWithIndifferentAccess with everything from params. If none...

...public/packs/**/*", "public/packs-test/**/*", "spec/fixtures/*", "gurney.yml", ".geordi.yml", "**/*/*.min.css", "**/*/*.min.js" ] } } Note Use the output.instructionFilePath option to always include a file containing instructions for the LLM. Make no mistakes. Alternative bash alias

makandra dev

...nonwords: false }], '@stylistic/spaced-comment': ['error', 'always', { line: { markers: ['*package', '!', '/', ',', '='] }, block: { balanced: true, markers: ['*package', '!', ',', ':', '::', 'flow-include'], exceptions: ['*'] } }], '@stylistic/template-curly-spacing': ['error', 'never'], '@stylistic/template-tag-spacing': ['error', 'never'], '@stylistic/wrap-iife': ['error', 'any', { functionPrototypeMethods: true }], '@stylistic/yield-star-spacing': ['error', 'both...

...necessary, because you now load those libraries through esbuild. adapt your app/assets/config/manifest.js file to include only the folders that sprockets needs to take care of, e.g.: //= link_tree ../builds/

...automatically installed packages that no other packages depend on any more. This, of course, includes obsolete kernel versions, with the explicit exception of the currently running kernel, the kernel version...

...must only differ in their conditions (#where, #having). If either side has a #join, #includes, etc., it will throw an error: authorized_users.and(filtered_users.join(:account)).to_sql # => ArgumentError: Relation passed to...

@cards = Card .where(...) .preload(:user, :deck) .to_a end end You can include strict_loading somewhere in the scope chain: class CardsController < ApplicationController def index @cards = Card

makandra dev

...Vacation.create(period: 2.weeks.ago..1.day.ago) Note In Ruby 1...10 excludes 10 and 1..10 includes 10. Ruby also supports 1.. and ..1 as endless ranges. Syntax [,]::daterange or (,)::daterange...

...contains all days [2025-12-12, 2026-12-12)::daterange // 12.12.2025 until but not including 12.12.2026 [2025-12-12, 2026-12-12]::daterange // 12.12.2025 until 12.12.2026 [2025-12-12, ]::daterange...

...const textReplace = require('esbuild-plugin-text-replace') const esbuild = require('esbuild') esbuild.build({ ... plugins: [ textReplace({ include: /jasmine-core\/lib\/jasmine-core\/jasmine\.js$/, pattern: [ ['let jasmineRequire;', 'let jasmineRequire; const global = window;'], // Make Jasmine...

github.com

ruby-warning adds custom processing for warnings, including the ability to ignore specific warning messages, ignore warnings in specific files/directories, include backtraces with warnings, treat warnings as errors, deduplicate warnings...

makandra dev
gist.github.com

...of all commands in the byebug guide The linked cheatsheet at the bottom also includes some examples and all the aliases to every command with a different useful structuring of...

...access to some path methods generated by your routes. Even though you could technically include Rails.application.routes.url_helpers, this may include way too many methods and even overwrite some class methods...

...an escape sequence like this: echo -en "\033]0;Hello\a" You can easily include the current path: echo -en "\033]0;$(pwd)\a" Or, to replace your home directory...

...return withAuthorizedUser(async ({ accessibleBy }) => { const prisma = await prismaClient() const comment = await prisma.comment.findUnique({ where: { uuid }, include: { file: true }, }) if (!comment) { return notFound() } await prisma.comment.delete({ where: { uuid, AND: accessibleBy('delete').Comment, }, }) revalidatePath...