mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-30 20:51:23 -04:00
Merge pull request #2349 from Br3nda/rails-target
Update rubocop to represent to rails 5.2
This commit is contained in:
37
.rubocop.yml
37
.rubocop.yml
@@ -4,7 +4,7 @@ AllCops:
|
||||
Exclude:
|
||||
- 'db/schema.rb'
|
||||
- 'vendor/**/*'
|
||||
TargetRailsVersion: 5.0
|
||||
TargetRailsVersion: 5.2
|
||||
|
||||
Rails:
|
||||
Enabled: true
|
||||
@@ -15,15 +15,6 @@ Naming/FileName:
|
||||
- 'Gemfile'
|
||||
- 'Gemfile.lock'
|
||||
|
||||
Style/StringLiterals:
|
||||
Enabled: false
|
||||
|
||||
Style/PercentLiteralDelimiters:
|
||||
PreferredDelimiters:
|
||||
default: ()
|
||||
'%i': ()
|
||||
'%w': ()
|
||||
|
||||
Layout/MultilineMethodCallIndentation:
|
||||
EnforcedStyle: indented
|
||||
|
||||
@@ -36,11 +27,16 @@ Layout/HashAlignment:
|
||||
Layout/ParameterAlignment:
|
||||
EnforcedStyle: with_fixed_indentation
|
||||
|
||||
|
||||
Style/Documentation:
|
||||
Style/StringLiterals:
|
||||
Enabled: false
|
||||
|
||||
Style/FrozenStringLiteralComment:
|
||||
Style/PercentLiteralDelimiters:
|
||||
PreferredDelimiters:
|
||||
default: ()
|
||||
'%i': ()
|
||||
'%w': ()
|
||||
|
||||
Style/Documentation:
|
||||
Enabled: false
|
||||
|
||||
# Configuration parameters: Include.
|
||||
@@ -56,22 +52,9 @@ Metrics/BlockLength:
|
||||
- '**/*.rake'
|
||||
- 'config/**/*.rb'
|
||||
|
||||
Metrics/LineLength:
|
||||
Layout/LineLength:
|
||||
Max: 140
|
||||
|
||||
# Remove the following once the code style matches
|
||||
Metrics/MethodLength:
|
||||
Max: 34
|
||||
Metrics/AbcSize:
|
||||
Max: 33
|
||||
# Configuration parameters: CountComments.
|
||||
Metrics/ClassLength:
|
||||
Max: 171
|
||||
Metrics/CyclomaticComplexity:
|
||||
Max: 8
|
||||
Metrics/PerceivedComplexity:
|
||||
Max: 9
|
||||
|
||||
# Places we use update_all, etc even though it skips validations.
|
||||
Rails/SkipsModelValidations:
|
||||
Exclude:
|
||||
|
||||
@@ -10,48 +10,6 @@ Lint/AmbiguousOperator:
|
||||
Exclude:
|
||||
- 'spec/controllers/crops_controller_spec.rb'
|
||||
|
||||
# Configuration parameters: AllowComments.
|
||||
Lint/SuppressedException:
|
||||
Exclude:
|
||||
- 'lib/tasks/testing.rake'
|
||||
|
||||
Lint/UselessAssignment:
|
||||
Exclude:
|
||||
- 'config.rb'
|
||||
- 'config/compass.rb'
|
||||
|
||||
Metrics/AbcSize:
|
||||
Max: 125
|
||||
|
||||
# Configuration parameters: CountComments, ExcludedMethods.
|
||||
# ExcludedMethods: refine
|
||||
Metrics/BlockLength:
|
||||
Max: 59
|
||||
|
||||
# Configuration parameters: CountComments.
|
||||
Metrics/ClassLength:
|
||||
Max: 186
|
||||
|
||||
Metrics/CyclomaticComplexity:
|
||||
Max: 29
|
||||
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
||||
# URISchemes: http, https
|
||||
Metrics/LineLength:
|
||||
Max: 341
|
||||
|
||||
# Configuration parameters: CountComments, ExcludedMethods.
|
||||
Metrics/MethodLength:
|
||||
Max: 106
|
||||
|
||||
# Configuration parameters: CountComments.
|
||||
Metrics/ModuleLength:
|
||||
Max: 107
|
||||
|
||||
Metrics/PerceivedComplexity:
|
||||
Max: 29
|
||||
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
# SupportedStyles: lowercase, uppercase
|
||||
Naming/HeredocDelimiterCase:
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
class MembersController < ApplicationController
|
||||
before_action :admin!
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
class RolesController < ApplicationController
|
||||
before_action :admin!
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AdminController < ApplicationController
|
||||
respond_to :html
|
||||
def index
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AlternateNamesController < ApplicationController
|
||||
before_action :authenticate_member!, except: %i(index)
|
||||
load_and_authorize_resource
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module V1
|
||||
class BaseController < JSONAPI::ResourceController
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module V1
|
||||
class CropsController < BaseController
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module V1
|
||||
class GardensController < BaseController
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module V1
|
||||
class HarvestsController < BaseController
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module V1
|
||||
class MembersController < BaseController
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module V1
|
||||
class PhotosController < BaseController
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module V1
|
||||
class PlantingsController < BaseController
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module V1
|
||||
class SeedsController < BaseController
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ApplicationController < ActionController::Base
|
||||
protect_from_forgery
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require './lib/actions/oauth_signup_action'
|
||||
class AuthenticationsController < ApplicationController
|
||||
before_action :authenticate_member!
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Charts
|
||||
class CropsController < ApplicationController
|
||||
respond_to :json
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Charts
|
||||
class GardensController < ApplicationController
|
||||
respond_to :json
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CommentsController < ApplicationController
|
||||
before_action :authenticate_member!, except: %i(index)
|
||||
load_and_authorize_resource
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ConversationsController < ApplicationController
|
||||
respond_to :html
|
||||
before_action :authenticate_member!
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'will_paginate/array'
|
||||
|
||||
class CropsController < ApplicationController
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class FollowsController < ApplicationController
|
||||
before_action :set_member, only: %i(index followers)
|
||||
load_and_authorize_resource
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ForumsController < ApplicationController
|
||||
load_and_authorize_resource
|
||||
respond_to :html, :json
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class GardenTypesController < ApplicationController
|
||||
respond_to :html, :json
|
||||
load_and_authorize_resource
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class HomeController < ApplicationController
|
||||
skip_authorize_resource
|
||||
respond_to :html
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class LikesController < ApplicationController
|
||||
before_action :authenticate_member!
|
||||
respond_to :html, :json
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class MembersController < ApplicationController
|
||||
load_and_authorize_resource except: %i(finish_signup unsubscribe view_follows view_followers show)
|
||||
skip_authorize_resource only: %i(nearby unsubscribe finish_signup)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class MessagesController < ApplicationController
|
||||
respond_to :html, :json
|
||||
before_action :authenticate_member!
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require './lib/actions/oauth_signup_action'
|
||||
|
||||
#
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class PagesController < ApplicationController
|
||||
def letsencrypt
|
||||
# use your code here, not mine
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class PasswordsController < Devise::PasswordsController
|
||||
protected
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class PhotoAssociationsController < ApplicationController
|
||||
before_action :authenticate_member!
|
||||
respond_to :json, :html
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class PhotosController < ApplicationController
|
||||
before_action :authenticate_member!, except: %i(index show)
|
||||
after_action :expire_homepage, only: %i(create destroy)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class PlacesController < ApplicationController
|
||||
skip_authorize_resource
|
||||
respond_to :html, :json
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class PlantPartsController < ApplicationController
|
||||
load_and_authorize_resource
|
||||
respond_to :html, :json
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class PostsController < ApplicationController
|
||||
before_action :authenticate_member!, except: %i(index show)
|
||||
load_and_authorize_resource
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class RegistrationsController < Devise::RegistrationsController
|
||||
respond_to :json
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class RobotsController < ApplicationController
|
||||
DEFAULT_FILENAME = 'config/robots.txt'.freeze
|
||||
DEFAULT_FILENAME = 'config/robots.txt'
|
||||
|
||||
def robots
|
||||
filename = "config/robots.#{subdomain}.txt" if subdomain && subdomain != 'www'
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ScientificNamesController < ApplicationController
|
||||
before_action :authenticate_member!, except: %i(index show)
|
||||
load_and_authorize_resource
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class SessionsController < Devise::SessionsController
|
||||
respond_to :html, :json
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class TimelineController < ApplicationController
|
||||
def index
|
||||
if current_member
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ApplicationHelper
|
||||
def parse_date(str)
|
||||
str ||= '' # Date.parse barfs on nil
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module AutoSuggestHelper
|
||||
def auto_suggest(resource, source, options = {})
|
||||
if options[:default] && !options[:default].new_record?
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module ButtonsHelper
|
||||
include IconsHelper
|
||||
def garden_plant_something_button(garden, classes: "btn btn-default")
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module CropsHelper
|
||||
def display_seed_availability(member, crop)
|
||||
seeds = member.seeds.where(crop: crop)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module EditableFormHelper
|
||||
def editable(field_type, model, field, display_field:, collection: [])
|
||||
render 'shared/editable/form', field_type: field_type,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module EventHelper
|
||||
def in_weeks(days)
|
||||
(days / 7.0).round
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module GardensHelper
|
||||
def display_garden_description(garden)
|
||||
if garden.description.nil?
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module HarvestsHelper
|
||||
def display_quantity(harvest)
|
||||
human_quantity = display_human_quantity(harvest)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module IconsHelper
|
||||
include FontAwesome::Sass::Rails::ViewHelpers
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module PhotosHelper
|
||||
def crop_image_path(crop)
|
||||
thumbnail_url(crop.default_photo)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module PlantingsHelper
|
||||
def display_finished(planting)
|
||||
if planting.finished_at.present?
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module PostsHelper
|
||||
def display_post_truncated(post)
|
||||
length = 300
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module SeedsHelper
|
||||
def display_seed_quantity(seed)
|
||||
if seed.quantity.nil?
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ApplicationJob < ActiveJob::Base
|
||||
end
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ApplicationMailer < ActionMailer::Base
|
||||
default from: 'from@example.com'
|
||||
layout 'mailer'
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Notifier < ApplicationMailer
|
||||
# include NotificationsHelper
|
||||
default from: "Growstuff <#{ENV['GROWSTUFF_EMAIL']}>"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Ability
|
||||
include CanCan::Ability
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AlternateName < ApplicationRecord
|
||||
belongs_to :crop
|
||||
belongs_to :creator, class_name: 'Member', inverse_of: :created_alternate_names
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ApplicationRecord < ActiveRecord::Base
|
||||
self.abstract_class = true
|
||||
self.per_page = 36
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Authentication < ApplicationRecord
|
||||
belongs_to :member
|
||||
end
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Comment < ApplicationRecord
|
||||
belongs_to :author, class_name: 'Member', inverse_of: :comments
|
||||
belongs_to :post
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Finishable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Likeable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module MemberFlickr
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module MemberNewsletter
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module OpenFarmData
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Ownable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module PhotoCapable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module PredictHarvest
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module PredictPlanting
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Crop < ApplicationRecord
|
||||
extend FriendlyId
|
||||
include PhotoCapable
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CropCompanion < ApplicationRecord
|
||||
belongs_to :crop_a, class_name: :Crop
|
||||
belongs_to :crop_b, class_name: :Crop
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CropPost < ApplicationRecord
|
||||
belongs_to :crop
|
||||
belongs_to :post
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CsvImporter
|
||||
# used by db/seeds.rb and rake growstuff:import_crops
|
||||
# CSV fields:
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Follow < ApplicationRecord
|
||||
belongs_to :follower, class_name: "Member", inverse_of: :follows
|
||||
belongs_to :followed, class_name: "Member", inverse_of: :inverse_follows
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Forum < ApplicationRecord
|
||||
extend FriendlyId
|
||||
include Ownable
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Garden < ApplicationRecord
|
||||
extend FriendlyId
|
||||
include Geocodable
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class GardenType < ApplicationRecord
|
||||
extend FriendlyId
|
||||
friendly_id :name, use: %i(slugged finders)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Harvest < ApplicationRecord
|
||||
include ActionView::Helpers::NumberHelper
|
||||
extend FriendlyId
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Like < ApplicationRecord
|
||||
belongs_to :member
|
||||
belongs_to :likeable, polymorphic: true, counter_cache: true
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Member < ApplicationRecord
|
||||
include Discard::Model
|
||||
acts_as_messageable # messages can be sent to this model
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Notification < ApplicationRecord
|
||||
belongs_to :sender, class_name: 'Member', inverse_of: :sent_notifications
|
||||
belongs_to :recipient, class_name: 'Member', inverse_of: :notifications
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Photo < ApplicationRecord
|
||||
include Likeable
|
||||
include Ownable
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class PhotoAssociation < ApplicationRecord
|
||||
belongs_to :photo, inverse_of: :photo_associations
|
||||
belongs_to :photographable, polymorphic: true
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class PlantPart < ApplicationRecord
|
||||
extend FriendlyId
|
||||
friendly_id :name, use: %i(slugged finders)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Planting < ApplicationRecord
|
||||
extend FriendlyId
|
||||
include PhotoCapable
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Post < ApplicationRecord
|
||||
extend FriendlyId
|
||||
include Likeable
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Role < ApplicationRecord
|
||||
extend FriendlyId
|
||||
friendly_id :name, use: %i(slugged finders)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ScientificName < ApplicationRecord
|
||||
belongs_to :crop
|
||||
belongs_to :creator, class_name: 'Member', inverse_of: :created_scientific_names
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Seed < ApplicationRecord
|
||||
extend FriendlyId
|
||||
include PhotoCapable
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module V1
|
||||
class CropResource < BaseResource
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module V1
|
||||
class GardenResource < BaseResource
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module V1
|
||||
class HarvestResource < BaseResource
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module V1
|
||||
class MemberResource < BaseResource
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module V1
|
||||
class PhotoResource < BaseResource
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module V1
|
||||
class PlantingResource < BaseResource
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module V1
|
||||
class SeedResource < BaseResource
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class BaseResource < JSONAPI::Resource
|
||||
immutable
|
||||
abstract
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CropSearchService
|
||||
# Crop.search(string)
|
||||
def self.search(query, page: 1, per_page: 12, current_member: nil)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user