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
kind: Role | |
apiVersion: rbac.authorization.k8s.io/v1 | |
metadata: | |
name: redis-rest | |
namespace: MY_NAMESPACE | |
rules: | |
- apiGroups: ['extensions'] | |
resources: ['podsecuritypolicies'] | |
verbs: ['use'] | |
resourceNames: |
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
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: redis-rest | |
namespace: MY_NAMESPACE | |
spec: | |
type: NodePort | |
ports: | |
- name: http | |
port: 80 |
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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: redis-rest | |
namespace: MY_NAMESPACE | |
spec: | |
selector: | |
matchLabels: | |
app: redis-rest | |
template: |
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 IntervalWorker | |
def initialize(interval_id) | |
@interval_id = interval_id | |
end | |
def perform | |
interval = Interval.where(id: @interval_id).first | |
interval.complete! if interval.present? | |
end | |
end |
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 Seeders | |
module Lessons | |
class << self | |
def seed | |
Lesson.destroy_all | |
lessons = [] | |
base_path = 'db/seed_data' | |
Dir.glob(Rails.root.join(base_path, 'lessons', '*.yml')) do |file| | |
lesson = YAML.load_file(file) |
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
RSpec.configure do |config| | |
config.before(:suite) do | |
DatabaseCleaner.clean_with(:truncation) | |
end | |
config.before(:each) do | |
DatabaseCleaner.strategy = Capybara.current_driver == :rack_test ? :transaction : :truncation | |
DatabaseCleaner.clean | |
DatabaseCleaner.start | |
end |
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 Post < ActiveRecord::Base | |
belongs_to :author, | |
class_name: 'User', | |
foreign_key: 'author_id', | |
inverse_of: :posts | |
attr_accessible :body, :title | |
end |
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 User < ActiveRecord::Base | |
has_many :posts, | |
foreign_key: 'author_id', | |
inverse_of: :author | |
attr_accessible :name, :email | |
end |
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 Post < ActiveRecord::Base | |
belongs_to :user, | |
inverse_of: :posts | |
attr_accessible :body, :title | |
end |
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 User < ActiveRecord::Base | |
has_many :posts, | |
inverse_of: :user | |
attr_accessible :name, :email | |
end |
NewerOlder