mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-25 01:13:03 -04:00
Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9851231f2 | ||
|
|
f82eabec42 | ||
|
|
83bf752a02 | ||
|
|
6ffdd283e4 | ||
|
|
d8e138ae2d | ||
|
|
81b80d9bb7 | ||
|
|
f080a8a566 | ||
|
|
5a436f9d7f | ||
|
|
a4fd1c4a8e | ||
|
|
7277cb3523 | ||
|
|
522d10e053 | ||
|
|
f3a9b26c8e | ||
|
|
d8f5580ef9 | ||
|
|
d9e58f6bf0 | ||
|
|
60ec4e8d18 | ||
|
|
ede7e6e7f7 | ||
|
|
9c62f955e2 | ||
|
|
6b313c190f | ||
|
|
c575f9d03c | ||
|
|
95a4b0c66c |
26
Gemfile.lock
26
Gemfile.lock
@@ -208,7 +208,7 @@ GEM
|
||||
gli (>= 2.7.0)
|
||||
i18n (>= 0.6.4)
|
||||
rubyzip (>= 1.0.0)
|
||||
csv (3.3.1)
|
||||
csv (3.3.5)
|
||||
csv_shaper (1.4.0)
|
||||
activesupport (>= 3.0.0)
|
||||
csv
|
||||
@@ -277,7 +277,7 @@ GEM
|
||||
friendly_id (5.5.1)
|
||||
activerecord (>= 4.0.0)
|
||||
gbifrb (0.2.0)
|
||||
geocoder (1.8.5)
|
||||
geocoder (1.8.6)
|
||||
base64 (>= 0.1.0)
|
||||
csv (>= 3.0.0)
|
||||
gibbon (1.2.1)
|
||||
@@ -356,7 +356,7 @@ GEM
|
||||
rails-dom-testing (>= 1, < 3)
|
||||
railties (>= 4.2.0)
|
||||
thor (>= 0.14, < 2.0)
|
||||
json (2.13.2)
|
||||
json (2.15.0)
|
||||
json-schema (5.1.0)
|
||||
addressable (~> 2.8)
|
||||
jsonapi-resources (0.10.7)
|
||||
@@ -467,7 +467,7 @@ GEM
|
||||
pp (0.6.2)
|
||||
prettyprint
|
||||
prettyprint (0.2.0)
|
||||
prism (1.4.0)
|
||||
prism (1.5.1)
|
||||
pry (0.15.2)
|
||||
coderay (~> 1.1)
|
||||
method_source (~> 1.0)
|
||||
@@ -475,11 +475,11 @@ GEM
|
||||
date
|
||||
stringio
|
||||
public_suffix (6.0.1)
|
||||
puma (7.0.3)
|
||||
puma (7.0.4)
|
||||
nio4r (~> 2.0)
|
||||
query_diet (0.7.2)
|
||||
racc (1.8.1)
|
||||
rack (2.2.17)
|
||||
rack (2.2.18)
|
||||
rack-cors (2.0.2)
|
||||
rack (>= 2.0.0)
|
||||
rack-protection (3.2.0)
|
||||
@@ -546,7 +546,7 @@ GEM
|
||||
recaptcha (5.21.1)
|
||||
redis-client (0.23.2)
|
||||
connection_pool
|
||||
regexp_parser (2.11.2)
|
||||
regexp_parser (2.11.3)
|
||||
reline (0.6.2)
|
||||
io-console (~> 0.5)
|
||||
responders (3.1.1)
|
||||
@@ -601,7 +601,7 @@ GEM
|
||||
rswag-ui (2.16.0)
|
||||
actionpack (>= 5.2, < 8.1)
|
||||
railties (>= 5.2, < 8.1)
|
||||
rubocop (1.80.2)
|
||||
rubocop (1.81.0)
|
||||
json (~> 2.3)
|
||||
language_server-protocol (~> 3.17.0.2)
|
||||
lint_roller (~> 1.1.0)
|
||||
@@ -609,10 +609,10 @@ GEM
|
||||
parser (>= 3.3.0.2)
|
||||
rainbow (>= 2.2.2, < 4.0)
|
||||
regexp_parser (>= 2.9.3, < 3.0)
|
||||
rubocop-ast (>= 1.46.0, < 2.0)
|
||||
rubocop-ast (>= 1.47.1, < 2.0)
|
||||
ruby-progressbar (~> 1.7)
|
||||
unicode-display_width (>= 2.4.0, < 4.0)
|
||||
rubocop-ast (1.46.0)
|
||||
rubocop-ast (1.47.1)
|
||||
parser (>= 3.3.7.2)
|
||||
prism (~> 1.4)
|
||||
rubocop-capybara (2.22.1)
|
||||
@@ -697,9 +697,9 @@ GEM
|
||||
timeout (0.4.3)
|
||||
tzinfo (2.0.6)
|
||||
concurrent-ruby (~> 1.0)
|
||||
unicode-display_width (3.1.5)
|
||||
unicode-emoji (~> 4.0, >= 4.0.4)
|
||||
unicode-emoji (4.0.4)
|
||||
unicode-display_width (3.2.0)
|
||||
unicode-emoji (~> 4.1)
|
||||
unicode-emoji (4.1.0)
|
||||
unicorn (6.1.0)
|
||||
kgio (~> 2.6)
|
||||
raindrops (~> 0.7)
|
||||
|
||||
@@ -7,9 +7,9 @@ module Api
|
||||
@model.owner = context[:current_user]
|
||||
end
|
||||
|
||||
has_one :owner, class_name: 'Member'
|
||||
has_one :garden
|
||||
has_one :planting
|
||||
has_one :owner, class_name: 'Member', always_include_linkage_data: true
|
||||
has_one :garden, always_include_linkage_data: true
|
||||
has_one :planting, always_include_linkage_data: true
|
||||
|
||||
attribute :name
|
||||
attribute :description
|
||||
|
||||
@@ -12,7 +12,7 @@ module Api
|
||||
|
||||
has_many :photos
|
||||
|
||||
has_one :parent, class_name: 'Crop'
|
||||
has_one :parent, class_name: 'Crop', always_include_linkage_data: true
|
||||
|
||||
attribute :name
|
||||
attribute :en_wikipedia_url
|
||||
|
||||
@@ -7,7 +7,7 @@ module Api
|
||||
@model.owner = context[:current_user]
|
||||
end
|
||||
|
||||
has_one :owner, class_name: 'Member'
|
||||
has_one :owner, class_name: 'Member', always_include_linkage_data: true
|
||||
has_many :plantings
|
||||
has_many :photos
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ module Api
|
||||
@model.plant_part = PlantPart.first
|
||||
end
|
||||
|
||||
has_one :crop
|
||||
has_one :planting
|
||||
has_one :owner, class_name: 'Member'
|
||||
has_one :crop, always_include_linkage_data: true
|
||||
has_one :planting, always_include_linkage_data: true
|
||||
has_one :owner, class_name: 'Member', always_include_linkage_data: true
|
||||
# has_one :plant_part
|
||||
has_many :photos
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ module Api
|
||||
has_many :plantings, foreign_key: 'owner_id'
|
||||
has_many :harvests, foreign_key: 'owner_id'
|
||||
has_many :seeds, foreign_key: 'owner_id'
|
||||
has_many :activities, foreign_key: 'owner_id'
|
||||
|
||||
has_many :photos
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ module Api
|
||||
@model.owner = context[:current_user]
|
||||
end
|
||||
|
||||
has_one :owner, class_name: 'Member'
|
||||
has_one :owner, class_name: 'Member', always_include_linkage_data: true
|
||||
has_many :plantings
|
||||
has_many :gardens
|
||||
has_many :harvests
|
||||
|
||||
@@ -7,9 +7,9 @@ module Api
|
||||
@model.owner = context[:current_user]
|
||||
end
|
||||
|
||||
has_one :garden
|
||||
has_one :crop
|
||||
has_one :owner, class_name: 'Member'
|
||||
has_one :garden, always_include_linkage_data: true
|
||||
has_one :crop, always_include_linkage_data: true
|
||||
has_one :owner, class_name: 'Member', always_include_linkage_data: true
|
||||
has_many :photos
|
||||
has_many :harvests
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ module Api
|
||||
@model.owner = context[:current_user]
|
||||
end
|
||||
|
||||
has_one :owner, class_name: 'Member'
|
||||
has_one :crop
|
||||
has_one :owner, class_name: 'Member', always_include_linkage_data: true
|
||||
has_one :crop, always_include_linkage_data: true
|
||||
|
||||
attribute :description
|
||||
attribute :quantity
|
||||
|
||||
142
public/robots.txt
Normal file
142
public/robots.txt
Normal file
@@ -0,0 +1,142 @@
|
||||
# robots.txt for based on the one for http://www.wikipedia.org/ and friends
|
||||
|
||||
# Observed spamming large amounts of https://en.wikipedia.org/?curid=NNNNNN
|
||||
# and ignoring 429 ratelimit responses, claims to respect robots:
|
||||
# http://mj12bot.com/
|
||||
User-agent: MJ12bot
|
||||
Disallow: /
|
||||
|
||||
# advertising-related bots:
|
||||
User-agent: Mediapartners-Google*
|
||||
Disallow: /
|
||||
|
||||
# Wikipedia work bots:
|
||||
User-agent: IsraBot
|
||||
Disallow:
|
||||
|
||||
User-agent: Orthogaffe
|
||||
Disallow:
|
||||
|
||||
# Crawlers that are kind enough to obey, but which we'd rather not have
|
||||
# unless they're feeding search engines.
|
||||
User-agent: UbiCrawler
|
||||
Disallow: /
|
||||
|
||||
User-agent: DOC
|
||||
Disallow: /
|
||||
|
||||
User-agent: Zao
|
||||
Disallow: /
|
||||
|
||||
# Some bots are known to be trouble, particularly those designed to copy
|
||||
# entire sites. Please obey robots.txt.
|
||||
User-agent: sitecheck.internetseer.com
|
||||
Disallow: /
|
||||
|
||||
User-agent: Zealbot
|
||||
Disallow: /
|
||||
|
||||
User-agent: MSIECrawler
|
||||
Disallow: /
|
||||
|
||||
User-agent: SiteSnagger
|
||||
Disallow: /
|
||||
|
||||
User-agent: WebStripper
|
||||
Disallow: /
|
||||
|
||||
User-agent: WebCopier
|
||||
Disallow: /
|
||||
|
||||
User-agent: Fetch
|
||||
Disallow: /
|
||||
|
||||
User-agent: Offline Explorer
|
||||
Disallow: /
|
||||
|
||||
User-agent: Teleport
|
||||
Disallow: /
|
||||
|
||||
User-agent: TeleportPro
|
||||
Disallow: /
|
||||
|
||||
User-agent: WebZIP
|
||||
Disallow: /
|
||||
|
||||
User-agent: linko
|
||||
Disallow: /
|
||||
|
||||
User-agent: HTTrack
|
||||
Disallow: /
|
||||
|
||||
User-agent: Microsoft.URL.Control
|
||||
Disallow: /
|
||||
|
||||
User-agent: Xenu
|
||||
Disallow: /
|
||||
|
||||
User-agent: larbin
|
||||
Disallow: /
|
||||
|
||||
User-agent: libwww
|
||||
Disallow: /
|
||||
|
||||
User-agent: ZyBORG
|
||||
Disallow: /
|
||||
|
||||
User-agent: Download Ninja
|
||||
Disallow: /
|
||||
|
||||
# Misbehaving: requests much too fast:
|
||||
User-agent: fast
|
||||
Disallow: /
|
||||
|
||||
#
|
||||
# Sorry, wget in its recursive mode is a frequent problem.
|
||||
# Please read the man page and use it properly; there is a
|
||||
# --wait option you can use to set the delay between hits,
|
||||
# for instance.
|
||||
#
|
||||
User-agent: wget
|
||||
Disallow: /
|
||||
|
||||
#
|
||||
# The 'grub' distributed client has been *very* poorly behaved.
|
||||
#
|
||||
User-agent: grub-client
|
||||
Disallow: /
|
||||
|
||||
#
|
||||
# Doesn't follow robots.txt anyway, but...
|
||||
#
|
||||
User-agent: k2spider
|
||||
Disallow: /
|
||||
|
||||
#
|
||||
# Hits many times per second, not acceptable
|
||||
# http://www.nameprotect.com/botinfo.html
|
||||
User-agent: NPBot
|
||||
Disallow: /
|
||||
|
||||
# A capture bot, downloads gazillions of pages with no public benefit
|
||||
# http://www.webreaper.net/
|
||||
User-agent: WebReaper
|
||||
Disallow: /
|
||||
|
||||
# Per their statement, semrushbot respects crawl-delay directives
|
||||
# We want them to overall stay within reasonable request rates to
|
||||
# the backend (20 rps); keeping in mind that the crawl-delay will
|
||||
# be applied by site and not globally by the bot, 5 seconds seem
|
||||
# like a reasonable approximation
|
||||
User-agent: SemrushBot
|
||||
Crawl-delay: 5
|
||||
|
||||
#
|
||||
# Friendly, low-speed bots are welcome viewing pages, but not
|
||||
# dynamically-generated pages please.
|
||||
#
|
||||
# Another exception is for REST API documentation, located at
|
||||
# /api/rest_v1/?doc.
|
||||
#
|
||||
User-agent: *
|
||||
Disallow: /api/
|
||||
@@ -17,7 +17,8 @@ RSpec.describe 'Members', type: :request do
|
||||
"harvests" => harvests_as_json_api,
|
||||
"photos" => photos_as_json_api,
|
||||
"plantings" => plantings_as_json_api,
|
||||
"seeds" => seeds_as_json_api
|
||||
"seeds" => seeds_as_json_api,
|
||||
"activities" => activities_as_json_api
|
||||
} }
|
||||
end
|
||||
|
||||
@@ -41,6 +42,12 @@ RSpec.describe 'Members', type: :request do
|
||||
"related" => "#{resource_url}/seeds" } }
|
||||
end
|
||||
|
||||
let(:activities_as_json_api) do
|
||||
{ "links" =>
|
||||
{ "self" => "#{resource_url}/relationships/activities",
|
||||
"related" => "#{resource_url}/activities" } }
|
||||
end
|
||||
|
||||
let(:plantings_as_json_api) do
|
||||
{ "links" =>
|
||||
{ "self" =>
|
||||
@@ -74,6 +81,7 @@ RSpec.describe 'Members', type: :request do
|
||||
it { expect(subject['data']['relationships']).to include("seeds" => seeds_as_json_api) }
|
||||
it { expect(subject['data']['relationships']).to include("harvests" => harvests_as_json_api) }
|
||||
it { expect(subject['data']['relationships']).to include("photos" => photos_as_json_api) }
|
||||
it { expect(subject['data']['relationships']).to include("activities" => activities_as_json_api) }
|
||||
it { expect(subject['data']).to eq(member_encoded_as_json_api) }
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user