active_model_serializers 0.10.7 → 0.10.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +62 -1
  3. data/README.md +20 -20
  4. data/lib/action_controller/serialization.rb +11 -1
  5. data/lib/active_model/serializable_resource.rb +2 -0
  6. data/lib/active_model/serializer.rb +33 -18
  7. data/lib/active_model/serializer/adapter.rb +2 -0
  8. data/lib/active_model/serializer/adapter/attributes.rb +2 -0
  9. data/lib/active_model/serializer/adapter/base.rb +2 -0
  10. data/lib/active_model/serializer/adapter/json.rb +2 -0
  11. data/lib/active_model/serializer/adapter/json_api.rb +2 -0
  12. data/lib/active_model/serializer/adapter/null.rb +2 -0
  13. data/lib/active_model/serializer/array_serializer.rb +2 -0
  14. data/lib/active_model/serializer/association.rb +2 -0
  15. data/lib/active_model/serializer/attribute.rb +2 -0
  16. data/lib/active_model/serializer/belongs_to_reflection.rb +2 -0
  17. data/lib/active_model/serializer/collection_serializer.rb +6 -6
  18. data/lib/active_model/serializer/concerns/caching.rb +7 -2
  19. data/lib/active_model/serializer/error_serializer.rb +2 -0
  20. data/lib/active_model/serializer/errors_serializer.rb +2 -0
  21. data/lib/active_model/serializer/field.rb +2 -0
  22. data/lib/active_model/serializer/fieldset.rb +3 -1
  23. data/lib/active_model/serializer/has_many_reflection.rb +2 -0
  24. data/lib/active_model/serializer/has_one_reflection.rb +2 -0
  25. data/lib/active_model/serializer/lazy_association.rb +6 -2
  26. data/lib/active_model/serializer/link.rb +23 -0
  27. data/lib/active_model/serializer/lint.rb +2 -0
  28. data/lib/active_model/serializer/null.rb +2 -0
  29. data/lib/active_model/serializer/reflection.rb +9 -4
  30. data/lib/active_model/serializer/version.rb +3 -1
  31. data/lib/active_model_serializers.rb +20 -10
  32. data/lib/active_model_serializers/adapter.rb +3 -1
  33. data/lib/active_model_serializers/adapter/attributes.rb +23 -0
  34. data/lib/active_model_serializers/adapter/base.rb +2 -0
  35. data/lib/active_model_serializers/adapter/json.rb +2 -0
  36. data/lib/active_model_serializers/adapter/json_api.rb +14 -9
  37. data/lib/active_model_serializers/adapter/json_api/deserialization.rb +2 -0
  38. data/lib/active_model_serializers/adapter/json_api/error.rb +2 -0
  39. data/lib/active_model_serializers/adapter/json_api/jsonapi.rb +2 -0
  40. data/lib/active_model_serializers/adapter/json_api/link.rb +2 -0
  41. data/lib/active_model_serializers/adapter/json_api/meta.rb +2 -0
  42. data/lib/active_model_serializers/adapter/json_api/pagination_links.rb +2 -0
  43. data/lib/active_model_serializers/adapter/json_api/relationship.rb +2 -0
  44. data/lib/active_model_serializers/adapter/json_api/resource_identifier.rb +3 -1
  45. data/lib/active_model_serializers/adapter/null.rb +2 -0
  46. data/lib/active_model_serializers/callbacks.rb +2 -0
  47. data/lib/active_model_serializers/deprecate.rb +2 -0
  48. data/lib/active_model_serializers/deserialization.rb +2 -0
  49. data/lib/active_model_serializers/json_pointer.rb +2 -0
  50. data/lib/active_model_serializers/logging.rb +2 -0
  51. data/lib/active_model_serializers/lookup_chain.rb +2 -0
  52. data/lib/active_model_serializers/model.rb +2 -0
  53. data/lib/active_model_serializers/model/caching.rb +25 -0
  54. data/lib/active_model_serializers/railtie.rb +4 -0
  55. data/lib/active_model_serializers/register_jsonapi_renderer.rb +2 -0
  56. data/lib/active_model_serializers/serializable_resource.rb +4 -2
  57. data/lib/active_model_serializers/serialization_context.rb +2 -0
  58. data/lib/active_model_serializers/test.rb +2 -0
  59. data/lib/active_model_serializers/test/schema.rb +2 -0
  60. data/lib/active_model_serializers/test/serializer.rb +2 -0
  61. data/lib/generators/rails/resource_override.rb +2 -0
  62. data/lib/generators/rails/serializer_generator.rb +2 -0
  63. data/lib/grape/active_model_serializers.rb +2 -0
  64. data/lib/grape/formatters/active_model_serializers.rb +2 -0
  65. data/lib/grape/helpers/active_model_serializers.rb +2 -0
  66. data/lib/tasks/rubocop.rake +2 -0
  67. metadata +70 -295
  68. data/.github/ISSUE_TEMPLATE.md +0 -29
  69. data/.github/PULL_REQUEST_TEMPLATE.md +0 -15
  70. data/.gitignore +0 -35
  71. data/.rubocop.yml +0 -105
  72. data/.simplecov +0 -110
  73. data/.travis.yml +0 -52
  74. data/CODE_OF_CONDUCT.md +0 -74
  75. data/CONTRIBUTING.md +0 -105
  76. data/Gemfile +0 -72
  77. data/Rakefile +0 -74
  78. data/active_model_serializers.gemspec +0 -63
  79. data/appveyor.yml +0 -28
  80. data/bin/bench +0 -171
  81. data/bin/bench_regression +0 -316
  82. data/bin/rubocop +0 -38
  83. data/bin/serve_benchmark +0 -39
  84. data/docs/README.md +0 -41
  85. data/docs/STYLE.md +0 -58
  86. data/docs/general/adapters.md +0 -269
  87. data/docs/general/caching.md +0 -58
  88. data/docs/general/configuration_options.md +0 -185
  89. data/docs/general/deserialization.md +0 -100
  90. data/docs/general/fields.md +0 -31
  91. data/docs/general/getting_started.md +0 -133
  92. data/docs/general/instrumentation.md +0 -40
  93. data/docs/general/key_transforms.md +0 -40
  94. data/docs/general/logging.md +0 -21
  95. data/docs/general/rendering.md +0 -293
  96. data/docs/general/serializers.md +0 -483
  97. data/docs/how-open-source-maintained.jpg +0 -0
  98. data/docs/howto/add_pagination_links.md +0 -138
  99. data/docs/howto/add_relationship_links.md +0 -140
  100. data/docs/howto/add_root_key.md +0 -62
  101. data/docs/howto/grape_integration.md +0 -42
  102. data/docs/howto/outside_controller_use.md +0 -66
  103. data/docs/howto/passing_arbitrary_options.md +0 -27
  104. data/docs/howto/serialize_poro.md +0 -73
  105. data/docs/howto/test.md +0 -154
  106. data/docs/howto/upgrade_from_0_8_to_0_10.md +0 -265
  107. data/docs/integrations/ember-and-json-api.md +0 -147
  108. data/docs/integrations/grape.md +0 -19
  109. data/docs/jsonapi/errors.md +0 -56
  110. data/docs/jsonapi/schema.md +0 -151
  111. data/docs/jsonapi/schema/schema.json +0 -366
  112. data/docs/rfcs/0000-namespace.md +0 -106
  113. data/docs/rfcs/template.md +0 -15
  114. data/test/action_controller/adapter_selector_test.rb +0 -62
  115. data/test/action_controller/explicit_serializer_test.rb +0 -135
  116. data/test/action_controller/json/include_test.rb +0 -246
  117. data/test/action_controller/json_api/deserialization_test.rb +0 -112
  118. data/test/action_controller/json_api/errors_test.rb +0 -40
  119. data/test/action_controller/json_api/fields_test.rb +0 -66
  120. data/test/action_controller/json_api/linked_test.rb +0 -202
  121. data/test/action_controller/json_api/pagination_test.rb +0 -124
  122. data/test/action_controller/json_api/transform_test.rb +0 -189
  123. data/test/action_controller/lookup_proc_test.rb +0 -49
  124. data/test/action_controller/namespace_lookup_test.rb +0 -232
  125. data/test/action_controller/serialization_scope_name_test.rb +0 -235
  126. data/test/action_controller/serialization_test.rb +0 -472
  127. data/test/active_model_serializers/adapter_for_test.rb +0 -208
  128. data/test/active_model_serializers/json_pointer_test.rb +0 -22
  129. data/test/active_model_serializers/logging_test.rb +0 -77
  130. data/test/active_model_serializers/model_test.rb +0 -142
  131. data/test/active_model_serializers/railtie_test_isolated.rb +0 -68
  132. data/test/active_model_serializers/register_jsonapi_renderer_test_isolated.rb +0 -161
  133. data/test/active_model_serializers/serialization_context_test_isolated.rb +0 -71
  134. data/test/active_model_serializers/test/schema_test.rb +0 -131
  135. data/test/active_model_serializers/test/serializer_test.rb +0 -62
  136. data/test/active_record_test.rb +0 -9
  137. data/test/adapter/attributes_test.rb +0 -40
  138. data/test/adapter/deprecation_test.rb +0 -100
  139. data/test/adapter/json/belongs_to_test.rb +0 -45
  140. data/test/adapter/json/collection_test.rb +0 -104
  141. data/test/adapter/json/has_many_test.rb +0 -53
  142. data/test/adapter/json/transform_test.rb +0 -93
  143. data/test/adapter/json_api/belongs_to_test.rb +0 -155
  144. data/test/adapter/json_api/collection_test.rb +0 -96
  145. data/test/adapter/json_api/errors_test.rb +0 -76
  146. data/test/adapter/json_api/fields_test.rb +0 -96
  147. data/test/adapter/json_api/has_many_explicit_serializer_test.rb +0 -96
  148. data/test/adapter/json_api/has_many_test.rb +0 -173
  149. data/test/adapter/json_api/has_one_test.rb +0 -80
  150. data/test/adapter/json_api/include_data_if_sideloaded_test.rb +0 -213
  151. data/test/adapter/json_api/json_api_test.rb +0 -33
  152. data/test/adapter/json_api/linked_test.rb +0 -413
  153. data/test/adapter/json_api/links_test.rb +0 -95
  154. data/test/adapter/json_api/pagination_links_test.rb +0 -206
  155. data/test/adapter/json_api/parse_test.rb +0 -137
  156. data/test/adapter/json_api/relationship_test.rb +0 -397
  157. data/test/adapter/json_api/resource_meta_test.rb +0 -100
  158. data/test/adapter/json_api/toplevel_jsonapi_test.rb +0 -82
  159. data/test/adapter/json_api/transform_test.rb +0 -512
  160. data/test/adapter/json_api/type_test.rb +0 -193
  161. data/test/adapter/json_test.rb +0 -46
  162. data/test/adapter/null_test.rb +0 -22
  163. data/test/adapter/polymorphic_test.rb +0 -218
  164. data/test/adapter_test.rb +0 -67
  165. data/test/array_serializer_test.rb +0 -22
  166. data/test/benchmark/app.rb +0 -65
  167. data/test/benchmark/benchmarking_support.rb +0 -67
  168. data/test/benchmark/bm_active_record.rb +0 -81
  169. data/test/benchmark/bm_adapter.rb +0 -38
  170. data/test/benchmark/bm_caching.rb +0 -119
  171. data/test/benchmark/bm_lookup_chain.rb +0 -83
  172. data/test/benchmark/bm_transform.rb +0 -45
  173. data/test/benchmark/config.ru +0 -3
  174. data/test/benchmark/controllers.rb +0 -83
  175. data/test/benchmark/fixtures.rb +0 -219
  176. data/test/cache_test.rb +0 -651
  177. data/test/collection_serializer_test.rb +0 -127
  178. data/test/fixtures/active_record.rb +0 -113
  179. data/test/fixtures/poro.rb +0 -225
  180. data/test/generators/scaffold_controller_generator_test.rb +0 -24
  181. data/test/generators/serializer_generator_test.rb +0 -75
  182. data/test/grape_test.rb +0 -196
  183. data/test/lint_test.rb +0 -49
  184. data/test/logger_test.rb +0 -20
  185. data/test/poro_test.rb +0 -9
  186. data/test/serializable_resource_test.rb +0 -79
  187. data/test/serializers/association_macros_test.rb +0 -37
  188. data/test/serializers/associations_test.rb +0 -468
  189. data/test/serializers/attribute_test.rb +0 -153
  190. data/test/serializers/attributes_test.rb +0 -52
  191. data/test/serializers/caching_configuration_test_isolated.rb +0 -170
  192. data/test/serializers/configuration_test.rb +0 -32
  193. data/test/serializers/fieldset_test.rb +0 -14
  194. data/test/serializers/meta_test.rb +0 -202
  195. data/test/serializers/options_test.rb +0 -32
  196. data/test/serializers/read_attribute_for_serialization_test.rb +0 -79
  197. data/test/serializers/reflection_test.rb +0 -427
  198. data/test/serializers/root_test.rb +0 -21
  199. data/test/serializers/serialization_test.rb +0 -55
  200. data/test/serializers/serializer_for_test.rb +0 -136
  201. data/test/serializers/serializer_for_with_namespace_test.rb +0 -88
  202. data/test/support/custom_schemas/active_model_serializers/test/schema_test/my/index.json +0 -6
  203. data/test/support/isolated_unit.rb +0 -84
  204. data/test/support/rails5_shims.rb +0 -53
  205. data/test/support/rails_app.rb +0 -38
  206. data/test/support/schemas/active_model_serializers/test/schema_test/my/index.json +0 -6
  207. data/test/support/schemas/active_model_serializers/test/schema_test/my/show.json +0 -6
  208. data/test/support/schemas/custom/show.json +0 -7
  209. data/test/support/schemas/hyper_schema.json +0 -93
  210. data/test/support/schemas/render_using_json_api.json +0 -43
  211. data/test/support/schemas/simple_json_pointers.json +0 -10
  212. data/test/support/serialization_testing.rb +0 -79
  213. data/test/test_helper.rb +0 -70
@@ -1,29 +0,0 @@
1
- #### Expected behavior vs actual behavior
2
-
3
-
4
-
5
- #### Steps to reproduce
6
- *(e.g., detailed walkthrough, runnable script, example application)*
7
-
8
-
9
-
10
- #### Environment
11
-
12
- ActiveModelSerializers Version *(commit ref if not on tag)*:
13
-
14
- Output of `ruby -e "puts RUBY_DESCRIPTION"`:
15
-
16
- OS Type & Version:
17
-
18
- Integrated application and version *(e.g., Rails, Grape, etc)*:
19
-
20
-
21
- #### Backtrace
22
- *(e.g., provide any applicable backtraces from your application)*
23
-
24
-
25
-
26
- #### Additonal helpful information
27
- *(e.g., Gemfile.lock, configurations, PR containing a failing test, git bisect results)*
28
-
29
-
@@ -1,15 +0,0 @@
1
- #### Purpose
2
-
3
-
4
- #### Changes
5
-
6
-
7
- #### Caveats
8
-
9
-
10
- #### Related GitHub issues
11
-
12
-
13
- #### Additional helpful information
14
-
15
-
data/.gitignore DELETED
@@ -1,35 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- Gemfile.local
8
- InstalledFiles
9
- _yardoc
10
- coverage
11
- doc/
12
- lib/bundler/man
13
- pkg
14
- Vagrantfile
15
- .vagrant
16
- rdoc
17
- spec/reports
18
- test/tmp
19
- test/version_tmp
20
- tmp
21
- *.swp
22
- .ruby-version
23
- .ruby-gemset
24
- vendor/bundle
25
- tags
26
-
27
- # silly macs
28
- .DS_Store
29
- .DS_Store?
30
- ._*
31
- .Spotlight-V100
32
- .Trashes
33
- Icon?
34
- ehthumbs.db
35
- Thumbs.db
@@ -1,105 +0,0 @@
1
- AllCops:
2
- TargetRubyVersion: 2.1
3
- Exclude:
4
- - !ruby/regexp /(vendor|bundle|bin|db|tmp)\/.*/
5
- DisplayCopNames: true
6
- DisplayStyleGuide: true
7
- # https://github.com/bbatsov/rubocop/blob/master/manual/caching.md
8
- # https://github.com/bbatsov/rubocop/blob/e8680418b351491e111a18cf5b453fc07a3c5239/config/default.yml#L60-L77
9
- UseCache: true
10
- CacheRootDirectory: tmp
11
-
12
- Rails:
13
- Enabled: true
14
-
15
- Lint/NestedMethodDefinition:
16
- Enabled: false
17
- Exclude:
18
- - test/action_controller/serialization_test.rb
19
-
20
- Style/Alias:
21
- EnforcedStyle: prefer_alias
22
-
23
- Style/StringLiterals:
24
- EnforcedStyle: single_quotes
25
-
26
- Metrics/AbcSize:
27
- Max: 35 # TODO: Lower to 15
28
-
29
- Metrics/ClassLength:
30
- Max: 261 # TODO: Lower to 100
31
- Exclude:
32
- - test/**/*.rb
33
-
34
- Metrics/CyclomaticComplexity:
35
- Max: 7 # TODO: Lower to 6
36
-
37
- Metrics/LineLength:
38
- Max: 251 # TODO: Lower to 80
39
-
40
- Metrics/MethodLength:
41
- Max: 106 # TODO: Lower to 10
42
-
43
- Metrics/PerceivedComplexity:
44
- Max: 9 # TODO: Lower to 7
45
-
46
- Style/AlignParameters:
47
- EnforcedStyle: with_fixed_indentation
48
-
49
- Style/ClassAndModuleChildren:
50
- EnforcedStyle: nested
51
-
52
- Style/Documentation:
53
- Enabled: false
54
-
55
- Style/MissingElse:
56
- Enabled: true
57
- EnforcedStyle: case
58
-
59
- Style/EmptyElse:
60
- EnforcedStyle: empty
61
-
62
- Style/MultilineOperationIndentation:
63
- EnforcedStyle: indented
64
-
65
- Style/BlockDelimiters:
66
- Enabled: true
67
- EnforcedStyle: line_count_based
68
-
69
- Style/SignalException:
70
- EnforcedStyle: semantic
71
-
72
- Style/TrailingCommaInLiteral:
73
- EnforcedStyleForMultiline: no_comma
74
-
75
- Style/ConditionalAssignment:
76
- Enabled: false
77
-
78
- Style/DotPosition:
79
- EnforcedStyle: leading
80
-
81
- ########## test_helper.rb sanity
82
- Style/EndBlock:
83
- Exclude:
84
- - test/test_helper.rb
85
-
86
- Style/SpecialGlobalVars:
87
- Exclude:
88
- - test/test_helper.rb
89
-
90
- Style/GlobalVars:
91
- Exclude:
92
- - test/test_helper.rb
93
-
94
- Style/AndOr:
95
- Exclude:
96
- - test/test_helper.rb
97
- - 'lib/active_model/serializer/lint.rb'
98
-
99
- Style/Not:
100
- Exclude:
101
- - test/test_helper.rb
102
-
103
- Style/ClassCheck:
104
- Exclude:
105
- - test/test_helper.rb
data/.simplecov DELETED
@@ -1,110 +0,0 @@
1
- # https://github.com/colszowka/simplecov#using-simplecov-for-centralized-config
2
- # see https://github.com/colszowka/simplecov/blob/master/lib/simplecov/defaults.rb
3
- # vim: set ft=ruby
4
-
5
- ## DEFINE VARIABLES
6
- @minimum_coverage = ENV.fetch('COVERAGE_MINIMUM') {
7
- case (defined?(RUBY_ENGINE) && RUBY_ENGINE) || "ruby"
8
- when 'jruby', 'rbx'
9
- 96.0
10
- else
11
- 98.1
12
- end
13
- }.to_f.round(2)
14
- # rubocop:disable Style/DoubleNegation
15
- ENV['FULL_BUILD'] ||= ENV['CI']
16
- @running_ci = !!(ENV['FULL_BUILD'] =~ /\Atrue\z/i)
17
- @generate_report = @running_ci || !!(ENV['COVERAGE'] =~ /\Atrue\z/i)
18
- @output = STDOUT
19
- # rubocop:enable Style/DoubleNegation
20
-
21
- ## CONFIGURE SIMPLECOV
22
-
23
- SimpleCov.profiles.define 'app' do
24
- coverage_dir 'coverage'
25
- load_profile 'test_frameworks'
26
-
27
- add_group 'Libraries', 'lib'
28
-
29
- add_group 'Long files' do |src_file|
30
- src_file.lines.count > 100
31
- end
32
- class MaxLinesFilter < SimpleCov::Filter
33
- def matches?(source_file)
34
- source_file.lines.count < filter_argument
35
- end
36
- end
37
- add_group 'Short files', MaxLinesFilter.new(5)
38
-
39
- # Exclude these paths from analysis
40
- add_filter '/config/'
41
- add_filter '/db/'
42
- add_filter 'tasks'
43
- add_filter '/.bundle/'
44
- end
45
-
46
- ## START TRACKING COVERAGE (before activating SimpleCov)
47
- require 'coverage'
48
- Coverage.start
49
-
50
- ## ADD SOME CUSTOM REPORTING AT EXIT
51
- SimpleCov.at_exit do
52
- next if $! and not ($!.kind_of? SystemExit and $!.success?)
53
-
54
- header = "#{'*' * 20} SimpleCov Results #{'*' * 20}"
55
- results = SimpleCov.result.format!.join("\n")
56
- exit_message = <<-EOF
57
-
58
- #{header}
59
- {{RESULTS}}
60
- {{FAILURE_MESSAGE}}
61
-
62
- #{'*' * header.size}
63
- EOF
64
- percent = Float(SimpleCov.result.covered_percent)
65
- if percent < @minimum_coverage
66
- failure_message = <<-EOF
67
- Spec coverage was not high enough: #{percent.round(2)}% is < #{@minimum_coverage}%
68
- EOF
69
- exit_message.sub!('{{RESULTS}}', results).sub!('{{FAILURE_MESSAGE}}', failure_message)
70
- @output.puts exit_message
71
- abort(failure_message) if @generate_report
72
- elsif @running_ci
73
- exit_message.sub!('{{RESULTS}}', results).sub!('{{FAILURE_MESSAGE}}', <<-EOF)
74
- Nice job! Spec coverage (#{percent.round(2)}%) is still at or above #{@minimum_coverage}%
75
- EOF
76
- @output.puts exit_message
77
- end
78
- end
79
-
80
- ## CAPTURE CONFIG IN CLOSURE 'AppCoverage.start'
81
- ## to defer running until test/test_helper.rb is loaded.
82
- # rubocop:disable Style/MultilineBlockChain
83
- AppCoverage = Class.new do
84
- def initialize(&block)
85
- @block = block
86
- end
87
-
88
- def start
89
- @block.call
90
- end
91
- end.new do
92
- SimpleCov.start 'app'
93
- if @generate_report
94
- if @running_ci
95
- require 'codeclimate-test-reporter'
96
- @output.puts '[COVERAGE] Running with SimpleCov Simple Formatter and CodeClimate Test Reporter'
97
- formatters = [
98
- SimpleCov::Formatter::SimpleFormatter,
99
- CodeClimate::TestReporter::Formatter
100
- ]
101
- else
102
- @output.puts '[COVERAGE] Running with SimpleCov HTML Formatter'
103
- formatters = [SimpleCov::Formatter::HTMLFormatter]
104
- end
105
- else
106
- formatters = []
107
- end
108
- SimpleCov.formatters = formatters
109
- end
110
- # rubocop:enable Style/MultilineBlockChain
@@ -1,52 +0,0 @@
1
- language: ruby
2
- sudo: false
3
-
4
- cache:
5
- directories:
6
- - vendor/bundle
7
-
8
- before_install:
9
- - "travis_retry gem update --system"
10
- - "travis_retry gem update bundler"
11
- install: bundle install --path=vendor/bundle --retry=3 --jobs=3
12
-
13
- script:
14
- - bundle exec rake ci
15
- after_success:
16
- - codeclimate-test-reporter
17
-
18
- env:
19
- matrix:
20
- - "RAILS_VERSION=4.1"
21
- - "RAILS_VERSION=4.2"
22
- - "RAILS_VERSION=5.0"
23
- - "RAILS_VERSION=5.1"
24
- - "RAILS_VERSION=master"
25
-
26
- rvm:
27
- - 2.1.10
28
- - 2.2.8
29
- - 2.3.5
30
- - 2.4.2
31
- - ruby-head
32
-
33
- matrix:
34
- include:
35
- - { rvm: jruby-9.1.13.0, jdk: oraclejdk8, env: "RAILS_VERSION=4.1 JRUBY_OPTS='--dev -J-Xmx1024M --debug'" }
36
- - { rvm: jruby-9.1.13.0, jdk: oraclejdk8, env: "RAILS_VERSION=4.2 JRUBY_OPTS='--dev -J-Xmx1024M --debug'" }
37
- - { rvm: jruby-9.1.13.0, jdk: oraclejdk8, env: "RAILS_VERSION=5.1 JRUBY_OPTS='--dev -J-Xmx1024M --debug'" }
38
- # See JRuby currently failing on Rails 5+ https://github.com/jruby/activerecord-jdbc-adapter/issues/708
39
- # - { rvm: jruby-9.1.13.0, jdk: oraclejdk8, env: "RAILS_VERSION=5.0 JRUBY_OPTS='--dev -J-Xmx1024M --debug'" }
40
- # - { rvm: jruby-head, jdk: oraclejdk8, env: "RAILS_VERSION=5.1 JRUBY_OPTS='--dev -J-Xmx1024M --debug'" }
41
- exclude:
42
- - { rvm: 2.1.10, env: RAILS_VERSION=master }
43
- - { rvm: 2.1.10, env: RAILS_VERSION=5.0 }
44
- - { rvm: 2.1.10, env: RAILS_VERSION=5.1 }
45
- - { rvm: 2.4.2, env: RAILS_VERSION=4.1 }
46
- - { rvm: ruby-head, env: RAILS_VERSION=4.1 }
47
- allow_failures:
48
- - rvm: ruby-head
49
- - rvm: jruby-head
50
- # See JRuby currently failing on Rails 5+ https://github.com/jruby/activerecord-jdbc-adapter/issues/708
51
- - { rvm: jruby-9.1.13.0, jdk: oraclejdk8, env: "RAILS_VERSION=5.1 JRUBY_OPTS='--dev -J-Xmx1024M --debug'" }
52
- fast_finish: true
@@ -1,74 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting one of the owners listed at https://rubygems.org/gems/active_model_serializers. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [http://contributor-covenant.org/version/1/4][version]
72
-
73
- [homepage]: http://contributor-covenant.org
74
- [version]: http://contributor-covenant.org/version/1/4/
@@ -1,105 +0,0 @@
1
- ## Have an issue?
2
-
3
- Before opening an issue, try the following:
4
-
5
- ##### Consult the documentation
6
-
7
- See if your issue can be resolved by information in the documentation.
8
-
9
- - [0.10 (master) Documentation](https://github.com/rails-api/active_model_serializers/tree/master/docs)
10
- - [![API Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://www.rubydoc.info/github/rails-api/active_model_serializers/v0.10.0)
11
- - [Guides](docs)
12
- - [0.9 (0-9-stable) Documentation](https://github.com/rails-api/active_model_serializers/tree/0-9-stable)
13
- - [0.8 (0-8-stable) Documentation](https://github.com/rails-api/active_model_serializers/tree/0-8-stable)
14
-
15
- ##### Check for an existing issue
16
-
17
- Take a look at the issues to see if a similar one has already been created. If
18
- one exists, please add any additional information that might expedite
19
- resolution.
20
-
21
- #### Open an issue
22
-
23
- If the documentation wasn't able to help resolve the issue and no issue already
24
- exists, please open a new issue with the following in mind:
25
-
26
- - Please make sure only to include one issue per report. If you encounter
27
- multiple, unrelated issues, please report them as such.
28
- - Be detailed. Provide backtraces and example code when possible. Provide
29
- information about your environment. e.g., Ruby version, rails version, etc.
30
- - Own your issue. Actively participate in the discussion and help drive the
31
- issue to closure.
32
- - If you resolve your own issue, please share the details on the issue and close
33
- it out. Others might have the same issue and sharing solutions is helpful.
34
-
35
- ## Contributing
36
-
37
- Contributing can be done in many ways and is not exclusive to code. If you have
38
- thoughts on a particular issue or feature, we encourage you to open new issues
39
- for discussion or add your comments to existing ones.
40
-
41
- #### Pull requests
42
-
43
- We also gladly welcome pull requests. When preparing to work on pull request,
44
- please adhere to these standards:
45
-
46
- - Base work on the master branch unless fixing an issue with
47
- [0.9-stable](https://github.com/rails-api/active_model_serializers/tree/0-9-stable)
48
- or
49
- [0.8-stable](https://github.com/rails-api/active_model_serializers/tree/0-8-stable)
50
- - Squash your commits and regularly rebase off master.
51
- - Provide a description of the changes contained in the pull request.
52
- - Note any specific areas that should be reviewed.
53
- - Include tests.
54
- - The test suite must pass on [supported Ruby versions](.travis.yml)
55
- - Include updates to the [documentation](https://github.com/rails-api/active_model_serializers/tree/master/docs)
56
- where applicable.
57
- - Update the
58
- [CHANGELOG](https://github.com/rails-api/active_model_serializers/blob/master/CHANGELOG.md)
59
- to the appropriate sections with a brief description of the changes.
60
- - Do not change the VERSION file.
61
-
62
- #### Running tests
63
-
64
- Run all tests
65
-
66
- `$ rake test`
67
-
68
- Run a single test suite
69
-
70
- `$ rake test TEST=path/to/test.rb`
71
-
72
- Run a single test
73
-
74
- `$ rake test TEST=path/to/test.rb TESTOPTS="--name=test_something"`
75
-
76
- Run tests against different Rails versions by setting the RAILS_VERSION variable
77
- and bundling gems. (save this script somewhere executable and run from top of AMS repository)
78
-
79
- ```bash
80
- #!/usr/bin/env bash
81
-
82
- rcommand='puts YAML.load_file("./.travis.yml")["env"]["matrix"].join(" ").gsub("RAILS_VERSION=", "")'
83
- versions=$(ruby -ryaml -e "$rcommand")
84
-
85
- for version in ${versions[@]}; do
86
- export RAILS_VERSION="$version"
87
- rm -f Gemfile.lock
88
- bundle check || bundle --local || bundle
89
- bundle exec rake test
90
- if [ "$?" -eq 0 ]; then
91
- # green in ANSI
92
- echo -e "\033[32m **** Tests passed against Rails ${RAILS_VERSION} **** \033[0m"
93
- else
94
- # red in ANSI
95
- echo -e "\033[31m **** Tests failed against Rails ${RAILS_VERSION} **** \033[0m"
96
- read -p '[Enter] any key to continue, [q] to quit...' prompt
97
- if [ "$prompt" = 'q' ]; then
98
- unset RAILS_VERSION
99
- exit 1
100
- fi
101
- fi
102
- unset RAILS_VERSION
103
- done
104
- ```
105
-