This file contains 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
module TenantServices | |
class AccessService | |
def initialize(params) | |
@site = params[:site] | |
@customer = params[:customer] | |
@user = params[:user] | |
@record = params[:record] | |
@feature = params[:feature] |
This file contains 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 GiftCard < ApplicationRecord | |
belongs_to :site | |
belongs_to :subscription_plan, optional: true | |
acts_as_tenant :site | |
include ProductConcern | |
include ImageUploader[:image] | |
enum status: { draft:0, published:1} |
This file contains 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
# Roles Table | |
Role.create([{name:'admin'},{name:'staff'}]) | |
# Users Roles Table | |
UserRole.create(user: User.find_by_username('corndog'), role: Role.find_by_name('admin')) | |
# User Model | |
class User < ApplicationRecord | |
def role?(role) | |
role.kind_of?(Array) ? role.map { |role| has_role?(role) }.any? : has_role?(role) |
This file contains 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
# In a View | |
<%= render 'bookmarks/add_remove', record: @lesson %> | |
# The Partial | |
<% if current_customer && current_customer.bookmarked_content?(record) %> | |
<%= button_to bookmark_path(current_customer.bookmark_for_content(record), bookmarkable_type:record.class.name, bookmarkable_id:record.id), method: :delete, class:'btn btn-sm btn-light box-shadow', form_class:'add-remove-bookmark', data:{disable_with:'Removing...'}, remote: true do %> | |
<%= ms_icon('minus-circle', title:'Unsave This') %> | |
<% end %> | |
<% else %> | |
<%= button_to bookmarks_path(bookmarkable_type:record.class.name, bookmarkable_id:record.id), method: :post, class:'btn btn-sm btn-light box-shadow', form_class:'add-remove-bookmark', data:{disable_with:'Adding...'}, remote: true do %> |
This file contains 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
/* | |
- .aesop-on-THEMENAME is a class that aesop applies to themes | |
- this breaks the width that sets on main column | |
- .single targeting only single posts | |
*/ | |
.aesop-on-make.single .container { | |
max-width:100%; | |
padding-left:0; | |
padding-right:0; | |
} |
This file contains 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
module Checkups::Notify | |
require 'slack-notify' | |
class Dispatch | |
def initialize(params) | |
@message = params[:message] | |
@room = params[:room] || '#web-dev_events' | |
@botname = params[:botname] || 'EDU Bot' |
This file contains 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
.aesop-on-genesis .site-inner{ | |
max-width:100%; | |
} | |
.aesop-on-genesis .entry { | |
padding-left:0; | |
padding-right:0; | |
} | |
.aesop-on-genesis .entry-header, | |
.aesop-on-genesis .entry-content > *:not(.aesop-component) { | |
width: 100%; |
This file contains 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
<?php | |
class sampleClass { | |
function __construct() { | |
add_filter( 'edd_settings_tabs', array($this,'test_tab' )); | |
add_action('admin_init', array($this,'edd_register_settings_test')); | |
} |
This file contains 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
<!-- Start Aesop Crowdhoster --> | |
<blockquote> | |
<p>...one of the most beautiful tools for Wordpress that I've seen in a long time.</p> | |
<cite>- <a href="http://wptavern.com/aesop-story-engine-an-open-source-wordpress-plugin-for-storytelling">WP Tavern</a></cite></blockquote> | |
<blockquote> | |
<p>...a potentially seismic shift in content creation and the biggest thing to hit WP for ages.</p> | |
<cite>- <a href="http://wptavern.com/aesop-story-engine-an-open-source-wordpress-plugin-for-storytelling#comment-50657">Chris Knowles</a></cite></blockquote> | |
<blockquote> |