diff --git a/.gitignore b/.gitignore index c1f8602..4d9bfcc 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ todos/log/*.log todos/tmp/ .gems/ coverage/ +.byebug_history \ No newline at end of file diff --git a/Gemfile b/Gemfile index 70a37bb..5729925 100644 --- a/Gemfile +++ b/Gemfile @@ -14,4 +14,6 @@ gemspec # your gem to rubygems.org. # To use a debugger -# gem 'byebug', group: [:development, :test] +gem 'byebug', group: [:development, :test] +gem 'awesome_print', group: [:development, :test] +gem 'shoulda-matchers', group: :test diff --git a/Gemfile.lock b/Gemfile.lock index 516ec84..8e749ef 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -56,8 +56,10 @@ GEM tzinfo (~> 1.1) arel (9.0.0) ast (2.4.1) + awesome_print (1.8.0) bcrypt (3.1.13) builder (3.2.4) + byebug (11.1.3) committee (3.3.0) json_schema (~> 0.14, >= 0.14.3) openapi_parser (>= 0.6.1) @@ -212,6 +214,8 @@ GEM activerecord (~> 5.0) schema_plus_columns valuable + shoulda-matchers (4.3.0) + activesupport (>= 4.2.0) simplecov (0.17.1) docile (~> 1.1) json (>= 1.8, < 3) @@ -241,6 +245,8 @@ PLATFORMS ruby DEPENDENCIES + awesome_print + byebug croods! gem-release pg @@ -249,6 +255,7 @@ DEPENDENCIES rspec_junit_formatter (~> 0.4.1) rubocop (= 0.80.1) rubocop-rspec (= 1.38.1) + shoulda-matchers simplecov (~> 0.17.0) timecop (= 0.9.1) diff --git a/spec/support/shoulda_matchers.rb b/spec/support/shoulda_matchers.rb new file mode 100644 index 0000000..dc0c322 --- /dev/null +++ b/spec/support/shoulda_matchers.rb @@ -0,0 +1,6 @@ +Shoulda::Matchers.configure do |config| + config.integrate do |with| + with.test_framework :rspec + with.library :rails + end +end \ No newline at end of file diff --git a/todos/app/resources/notes/model.rb b/todos/app/resources/notes/model.rb index 03f31cb..ed36a3c 100644 --- a/todos/app/resources/notes/model.rb +++ b/todos/app/resources/notes/model.rb @@ -5,9 +5,9 @@ module Model extend ActiveSupport::Concern included do - belongs_to :assignments, optional: true + belongs_to :assignment, optional: true - schema_validations auto_create: false + #schema_validations auto_create: false end end end diff --git a/todos/app/resources/notes/resource.rb b/todos/app/resources/notes/resource.rb index 0ac599f..2a3b1ad 100644 --- a/todos/app/resources/notes/resource.rb +++ b/todos/app/resources/notes/resource.rb @@ -3,5 +3,7 @@ module Notes class Resource < ApplicationResource filter_by :list + + extend_model { include Notes::Model } end end