active_record_extended 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -0
  3. data/lib/active_record_extended.rb +0 -0
  4. data/lib/active_record_extended/active_record.rb +0 -0
  5. data/lib/active_record_extended/arel.rb +0 -0
  6. data/lib/active_record_extended/arel/nodes.rb +0 -0
  7. data/lib/active_record_extended/arel/predications.rb +0 -0
  8. data/lib/active_record_extended/arel/visitors/postgresql_decorator.rb +0 -0
  9. data/lib/active_record_extended/patch/5_0/predicate_builder_decorator.rb +0 -0
  10. data/lib/active_record_extended/patch/5_1/where_clause.rb +0 -0
  11. data/lib/active_record_extended/patch/5_2/where_clause.rb +0 -0
  12. data/lib/active_record_extended/predicate_builder/array_handler_decorator.rb +0 -0
  13. data/lib/active_record_extended/query_methods/any_of.rb +0 -0
  14. data/lib/active_record_extended/query_methods/either.rb +0 -0
  15. data/lib/active_record_extended/query_methods/inet.rb +0 -0
  16. data/lib/active_record_extended/query_methods/where_chain.rb +0 -0
  17. data/lib/active_record_extended/version.rb +1 -1
  18. data/spec/active_record_extended_spec.rb +0 -0
  19. data/spec/query_methods/any_of_spec.rb +0 -0
  20. data/spec/query_methods/array_query_spec.rb +0 -0
  21. data/spec/query_methods/either_spec.rb +0 -0
  22. data/spec/query_methods/hash_query_spec.rb +0 -0
  23. data/spec/query_methods/inet_query_spec.rb +0 -0
  24. data/spec/spec_helper.rb +0 -0
  25. data/spec/sql_inspections/any_of_sql_spec.rb +0 -0
  26. data/spec/sql_inspections/arel/array_spec.rb +0 -0
  27. data/spec/sql_inspections/arel/inet_spec.rb +0 -0
  28. data/spec/sql_inspections/contains_sql_queries_spec.rb +0 -0
  29. data/spec/sql_inspections/either_sql_spec.rb +0 -0
  30. data/spec/support/database_cleaner.rb +0 -0
  31. data/spec/support/models.rb +0 -0
  32. metadata +4 -26
  33. data/.codeclimate.yml +0 -15
  34. data/.gitignore +0 -19
  35. data/.rspec +0 -3
  36. data/.rubocop.yml +0 -85
  37. data/.ruby-gemset +0 -1
  38. data/.ruby-version +0 -1
  39. data/.travis.yml +0 -42
  40. data/CHANGELOG.md +0 -78
  41. data/CODE_OF_CONDUCT.md +0 -74
  42. data/Gemfile +0 -17
  43. data/Gemfile.lock +0 -100
  44. data/LICENSE.txt +0 -21
  45. data/Rakefile +0 -104
  46. data/active_record_extended.gemspec +0 -33
  47. data/bin/console +0 -15
  48. data/bin/setup +0 -8
  49. data/gemfiles/activerecord-50.gemfile +0 -8
  50. data/gemfiles/activerecord-51.gemfile +0 -8
  51. data/gemfiles/activerecord-52+.gemfile +0 -8
  52. data/gemfiles/activerecord-52.gemfile +0 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf04baff8f2c548a04c254a10006d679cef656d9f47c3653273ee6f743d4aca0
4
- data.tar.gz: e2ca87d208e1c2dd0accd218dccf5fd2e872c812541d9c0d202a348b38497a6f
3
+ metadata.gz: 0e7c1bd1aaee6cd16497cd2f64bed3f06907a31ac48059da909dc33c0f4caa26
4
+ data.tar.gz: 5d1e21f8547272af210b11c7590e7094e69eeaad6714a50f76566b04eef3003e
5
5
  SHA512:
6
- metadata.gz: 55056d74f1c391f6af395253ca404525eb73d099d1dd104d5b9814361ba362fbdaf4c25b9a97414bd0098c0de96e07fb1792db4b143bab58a398b45d180381fb
7
- data.tar.gz: b8546ce2e9d0a550179991ba918713219ba6d0279d30c6fafc1c89e385f84b7d44cc95d9cde177f1a47492afd421fd6a32fbb14decc956be4a2ce52b4ce0893e
6
+ metadata.gz: 320aa807eded4abeb5f519b7e58b66a4cdaba77f62eaa0549bffeddc000bf6426726733337dd3dfc18e1c651594c7f2fb4f09c32f4d9bbe640a71abe16ce5fda
7
+ data.tar.gz: 3e8ffdc9e76ea8eb5ec47dba4d8d795bbcda5f780879213fc385074dea024ab01851b4b552631cb1011b2b83a949416348efbd749c442255e76b00e4ebcd9f38
data/README.md CHANGED
@@ -1,3 +1,4 @@
1
+ [![Gem Version](https://badge.fury.io/rb/active_record_extended.svg)](https://badge.fury.io/rb/active_record_extended)
1
2
  [![Build Status](https://travis-ci.com/GeorgeKaraszi/ActiveRecordExtended.svg?branch=master)](https://travis-ci.com/GeorgeKaraszi/ActiveRecordExtended)
2
3
  [![Maintainability](https://api.codeclimate.com/v1/badges/98ecffc0239417098cbc/maintainability)](https://codeclimate.com/github/GeorgeKaraszi/active_record_extended/maintainability)
3
4
  [![Test Coverage](https://api.codeclimate.com/v1/badges/f22154211bb3a8feb89f/test_coverage)](https://codeclimate.com/github/GeorgeKaraszi/ActiveRecordExtended/test_coverage)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveRecordExtended
4
- VERSION = "0.5.1"
4
+ VERSION = "0.6.0"
5
5
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/spec/spec_helper.rb CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record_extended
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - George Protacio-Karaszi
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-06-03 00:00:00.000000000 Z
13
+ date: 2018-07-25 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
@@ -141,33 +141,11 @@ email:
141
141
  - georgekaraszi@gmail.com
142
142
  - git@danmcclain.net
143
143
  - olivier@el-mekki.com
144
- executables:
145
- - console
146
- - setup
144
+ executables: []
147
145
  extensions: []
148
146
  extra_rdoc_files: []
149
147
  files:
150
- - ".codeclimate.yml"
151
- - ".gitignore"
152
- - ".rspec"
153
- - ".rubocop.yml"
154
- - ".ruby-gemset"
155
- - ".ruby-version"
156
- - ".travis.yml"
157
- - CHANGELOG.md
158
- - CODE_OF_CONDUCT.md
159
- - Gemfile
160
- - Gemfile.lock
161
- - LICENSE.txt
162
148
  - README.md
163
- - Rakefile
164
- - active_record_extended.gemspec
165
- - bin/console
166
- - bin/setup
167
- - gemfiles/activerecord-50.gemfile
168
- - gemfiles/activerecord-51.gemfile
169
- - gemfiles/activerecord-52+.gemfile
170
- - gemfiles/activerecord-52.gemfile
171
149
  - lib/active_record_extended.rb
172
150
  - lib/active_record_extended/active_record.rb
173
151
  - lib/active_record_extended/arel.rb
@@ -217,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
217
195
  version: '0'
218
196
  requirements: []
219
197
  rubyforge_project:
220
- rubygems_version: 2.7.6
198
+ rubygems_version: 2.7.7
221
199
  signing_key:
222
200
  specification_version: 4
223
201
  summary: Adds extended functionality to Activerecord Postgres implementation
data/.codeclimate.yml DELETED
@@ -1,15 +0,0 @@
1
- engines:
2
- rubocop:
3
- enabled: true
4
- channel: rubocop-0-54
5
- duplication:
6
- enabled: true
7
- config:
8
- languages:
9
- ruby:
10
- mass_threshold: 60
11
- ratings:
12
- paths:
13
- - lib/**
14
- exclude_paths:
15
- - spec/**/*
data/.gitignore DELETED
@@ -1,19 +0,0 @@
1
- .idea
2
-
3
- /.bundle/
4
- /.yardoc
5
- /_yardoc/
6
- /coverage/
7
- /doc/
8
- /pkg/
9
- /spec/reports/
10
- /tmp/
11
-
12
- # rspec failure tracking
13
- .rspec_status
14
- .env
15
- *.gem
16
- *.DS_Store
17
-
18
- .pryrc
19
- coverage
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/.rubocop.yml DELETED
@@ -1,85 +0,0 @@
1
- AllCops:
2
- TargetRubyVersion: 2.4
3
- DisplayStyleGuide: true
4
- DisplayCopNames: true
5
-
6
- #################
7
- # [i] Overrides #
8
- #################
9
-
10
- CollectionMethods:
11
- # Mapping from undesired method to desired_method
12
- # e.g. to use `detect` over `find`:
13
- #
14
- # CollectionMethods:
15
- # PreferredMethods:
16
- # find: detect
17
- PreferredMethods:
18
- reduce: 'inject'
19
- find: 'detect'
20
- each_with_index: 'each.with_index'
21
-
22
- # Align ends correctly.
23
- EndAlignment:
24
- EnforcedStyleAlignWith: variable
25
-
26
- LineLength:
27
- Max: 120
28
- Exclude:
29
- - examples/**/*
30
-
31
- BracesAroundHashParameters:
32
- EnforcedStyle: context_dependent
33
-
34
- StringLiterals:
35
- EnforcedStyle: double_quotes
36
-
37
- Metrics/AbcSize:
38
- Max: 18
39
-
40
- #################
41
- # Disabled cops #
42
- #################
43
- Metrics/ClassLength:
44
- Enabled: false
45
-
46
- Metrics/CyclomaticComplexity:
47
- Enabled: false
48
-
49
- Metrics/MethodLength:
50
- Enabled: false
51
-
52
- Metrics/BlockLength:
53
- Exclude:
54
- - spec/**/*
55
-
56
- Style/ClassAndModuleChildren:
57
- Enabled: false
58
-
59
- Style/Documentation:
60
- Enabled: false
61
-
62
- Style/Lambda:
63
- Enabled: false
64
-
65
- Style/IfUnlessModifier:
66
- Enabled: false
67
-
68
- Style/TrailingCommaInArrayLiteral:
69
- Enabled: true
70
- EnforcedStyleForMultiline: comma
71
-
72
- Style/TrailingCommaInHashLiteral:
73
- Enabled: true
74
- EnforcedStyleForMultiline: comma
75
-
76
- Style/TrailingCommaInArguments:
77
- Enabled: true
78
- EnforcedStyleForMultiline: comma
79
-
80
- Style/GuardClause:
81
- Enabled: false
82
-
83
- Lint/AmbiguousBlockAssociation:
84
- Exclude:
85
- - spec/**/*
data/.ruby-gemset DELETED
@@ -1 +0,0 @@
1
- active_record_extended
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 2.5.1
data/.travis.yml DELETED
@@ -1,42 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.3
5
- - 2.4
6
- - 2.5
7
- - ruby-head
8
-
9
- before_install: gem install bundler -v 1.16.1
10
-
11
- branches:
12
- only:
13
- - master
14
- gemfile:
15
- - gemfiles/activerecord-50.gemfile
16
- - gemfiles/activerecord-51.gemfile
17
- - gemfiles/activerecord-52.gemfile
18
- - gemfiles/activerecord-52+.gemfile
19
-
20
- matrix:
21
- allow_failures:
22
- - rvm: ruby-head
23
- - gemfile: gemfiles/activerecord-52+.gemfile
24
-
25
-
26
- env: DATABASE_URL=postgres://postgres@localhost/active_record_extended_test
27
-
28
- before_script:
29
- - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
30
- - chmod +x ./cc-test-reporter
31
- - ./cc-test-reporter before-build
32
- - psql -c 'create database active_record_extended_test;' -U postgres
33
- - bundle exec rake db:migrate
34
-
35
- after_script:
36
- - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
37
-
38
- cache:
39
- - bundler
40
-
41
- addons:
42
- postgresql: '9.6'
data/CHANGELOG.md DELETED
@@ -1,78 +0,0 @@
1
- # 0.5.1 - June 3rd 2018
2
-
3
- Relaxed PG gem requirement for allowing version 1 to be used.
4
-
5
- # 0.5.0 - May 31st 2018
6
-
7
- Released non-marked beta version.
8
-
9
- # 0.5.0.beta3 - May 28th 2018
10
-
11
- Added `inet_contains_or_contained_within/1` method
12
-
13
- # 0.5.0.beta2 - May 27th 2018
14
-
15
- Renamed inet functions to hopefully give a clearer understanding to what these methods are used for.
16
-
17
- Added support for Postgres Inet functions. View the readme for more details on the following:
18
-
19
- - `#inet_contained_within/1`
20
- - `#inet_contained_within_or_equals/1`
21
- - `#inet_contains_or_equals/1`
22
- - `#inet_contains/1`
23
-
24
- ### Deprecation Warnings
25
- The following will be dropped upon v1.0 release. In favor of their prefixed counterparts.
26
-
27
- - `#contained_within/1`
28
- - `#contained_within_or_equals/1`
29
- - `#contains_or_equals/1`
30
-
31
- # 0.5.0.beta1 - May 26th 2018
32
-
33
- Added support for Rails 5.0.x
34
-
35
- ### Warning for Rails 5.0.x Projects
36
- The proposed changes to this could cause unintended behavior in existing Rails 5.0.x applications.
37
- This is due to the overwrite needed to be done on its internal Predicate builder.
38
- Rails projects above 5.0.x should not experience any unforeseen issues since they contain the necessary structure required.
39
-
40
- **Use with caution.** And always make sure you have good tests to verify everything in your application.
41
-
42
- # 0.4.0 - May 9th 2018
43
-
44
- - Use Arel's `or` for grouping queries when using `#any_of` or `#none_of`
45
- - Added Plural aliases for `.either_join` : `.either_joins` and `.either_order` : `.either_orders`
46
-
47
- # 0.3.0 - May 9th 2018
48
-
49
- - Fixed ActiveRecord QueryMethod constant load error.
50
-
51
- # 0.2.1 - May 6th 2018
52
-
53
- Changed how where clause is required. This is to hopefully future proof the next minior update to ActiveRecord.
54
-
55
- # 0.2.0 - May 6th 2018
56
-
57
- Added ActiveRecord Where Chain Functionality
58
- - .where.any_of
59
- - .where.none_of
60
-
61
- Major thanks to [Olivier El Mekki author of ActiveRecord AnyOf](https://github.com/oelmekki/activerecord_any_of)
62
-
63
- # 0.1.1 - May 2nd 2018
64
-
65
- Added ActiveRecord Where Chain Functionality:
66
- - .where.overlap
67
- - .where.contained_within
68
- - .where.contained_within_or_equals
69
- - .where.contains_or_equals
70
- - .where.any/1
71
- - .where.all/1
72
-
73
- Major thanks to [Dan McClain author of Postgres Ext](https://github.com/dockyard/postgres_ext)
74
-
75
- Added ActiveRecord Base Extentions
76
- - .either_order/2
77
- - .either_join/2
78
-
data/CODE_OF_CONDUCT.md DELETED
@@ -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 the project team at georgekaraszi@gmail.com. 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/
data/Gemfile DELETED
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
-
7
- group :development, :test do
8
- gem "rubocop", "~> 0.52", require: false
9
-
10
- gem "dotenv"
11
-
12
- gem "byebug"
13
- gem "pry", "~> 0.11.3"
14
- gem "pry-byebug", "~> 3.5", ">= 3.5.1"
15
- end
16
-
17
- gemspec
data/Gemfile.lock DELETED
@@ -1,100 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- active_record_extended (0.5.1)
5
- activerecord (>= 5.0, < 6.0)
6
- ar_outer_joins (~> 0.2)
7
- pg (>= 0, < 1.1)
8
-
9
- GEM
10
- remote: https://rubygems.org/
11
- specs:
12
- activemodel (5.2.0)
13
- activesupport (= 5.2.0)
14
- activerecord (5.2.0)
15
- activemodel (= 5.2.0)
16
- activesupport (= 5.2.0)
17
- arel (>= 9.0)
18
- activesupport (5.2.0)
19
- concurrent-ruby (~> 1.0, >= 1.0.2)
20
- i18n (>= 0.7, < 2)
21
- minitest (~> 5.1)
22
- tzinfo (~> 1.1)
23
- ar_outer_joins (0.2.0)
24
- activerecord (>= 3.2)
25
- arel (9.0.0)
26
- ast (2.4.0)
27
- byebug (10.0.2)
28
- coderay (1.1.2)
29
- concurrent-ruby (1.0.5)
30
- database_cleaner (1.7.0)
31
- diff-lcs (1.3)
32
- docile (1.3.0)
33
- dotenv (2.4.0)
34
- i18n (1.0.1)
35
- concurrent-ruby (~> 1.0)
36
- json (2.1.0)
37
- method_source (0.9.0)
38
- minitest (5.11.3)
39
- parallel (1.12.1)
40
- parser (2.5.1.0)
41
- ast (~> 2.4.0)
42
- pg (1.0.0)
43
- powerpack (0.1.1)
44
- pry (0.11.3)
45
- coderay (~> 1.1.0)
46
- method_source (~> 0.9.0)
47
- pry-byebug (3.6.0)
48
- byebug (~> 10.0)
49
- pry (~> 0.10)
50
- rainbow (3.0.0)
51
- rake (10.5.0)
52
- rspec (3.7.0)
53
- rspec-core (~> 3.7.0)
54
- rspec-expectations (~> 3.7.0)
55
- rspec-mocks (~> 3.7.0)
56
- rspec-core (3.7.1)
57
- rspec-support (~> 3.7.0)
58
- rspec-expectations (3.7.0)
59
- diff-lcs (>= 1.2.0, < 2.0)
60
- rspec-support (~> 3.7.0)
61
- rspec-mocks (3.7.0)
62
- diff-lcs (>= 1.2.0, < 2.0)
63
- rspec-support (~> 3.7.0)
64
- rspec-support (3.7.1)
65
- rubocop (0.56.0)
66
- parallel (~> 1.10)
67
- parser (>= 2.5)
68
- powerpack (~> 0.1)
69
- rainbow (>= 2.2.2, < 4.0)
70
- ruby-progressbar (~> 1.7)
71
- unicode-display_width (~> 1.0, >= 1.0.1)
72
- ruby-progressbar (1.9.0)
73
- simplecov (0.16.1)
74
- docile (~> 1.1)
75
- json (>= 1.8, < 3)
76
- simplecov-html (~> 0.10.0)
77
- simplecov-html (0.10.2)
78
- thread_safe (0.3.6)
79
- tzinfo (1.2.5)
80
- thread_safe (~> 0.1)
81
- unicode-display_width (1.3.2)
82
-
83
- PLATFORMS
84
- ruby
85
-
86
- DEPENDENCIES
87
- active_record_extended!
88
- bundler (~> 1.16)
89
- byebug
90
- database_cleaner (~> 1.6)
91
- dotenv
92
- pry (~> 0.11.3)
93
- pry-byebug (~> 3.5, >= 3.5.1)
94
- rake (~> 10.0)
95
- rspec (~> 3.0)
96
- rubocop (~> 0.52)
97
- simplecov (~> 0.16)
98
-
99
- BUNDLED WITH
100
- 1.16.2
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2018 George Protacio-Karaszi
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
data/Rakefile DELETED
@@ -1,104 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- task default: :spec
9
-
10
- task :setup do
11
- if File.exist?(".env")
12
- puts "This will overwrite your existing .env file"
13
- end
14
- db_name = fetch_input("Enter your database name: [active_record_extended_test] ")
15
- db_user = fetch_input("Enter your database user: [] ")
16
- db_password = fetch_input("Enter your database password: [] ")
17
- db_server = fetch_input("Enter your database server: [localhost] ")
18
-
19
- db_name = "active_record_extended_test" if db_name.empty?
20
- db_password = ":#{db_password}" unless db_password.empty?
21
- db_server = "localhost" if db_server.empty?
22
- db_server = "@#{db_server}" unless db_user.empty?
23
- env_path = File.expand_path("./.env")
24
-
25
- File.open(env_path, "w") do |file|
26
- file.puts "DATABASE_NAME=#{db_name}"
27
- file.puts "DATABASE_URL=\"postgres://#{db_user}#{db_password}#{db_server}/#{db_name}\""
28
- end
29
-
30
- puts ".env file saved"
31
- end
32
-
33
- # rubocop:disable Metrics/BlockLength
34
-
35
- namespace :db do
36
- task :load_db_settings do
37
- require "active_record"
38
- unless ENV["DATABASE_URL"]
39
- require "dotenv"
40
- Dotenv.load
41
- end
42
- end
43
-
44
- task drop: :load_db_settings do
45
- `dropdb #{ENV["DATABASE_NAME"]}`
46
- end
47
-
48
- task create: :load_db_settings do
49
- `createdb #{ENV["DATABASE_NAME"]}`
50
- end
51
-
52
- task migrate: :load_db_settings do
53
- ActiveRecord::Base.establish_connection(ENV["DATABASE_URL"])
54
-
55
- ActiveRecord::Schema.define do
56
- enable_extension "hstore"
57
-
58
- create_table :people, force: true do |t|
59
- t.integer "tag_ids", array: true
60
- t.string "tags", array: true
61
- t.integer "personal_id"
62
- t.hstore "data"
63
- t.jsonb "jsonb_data"
64
- t.inet "ip"
65
- t.cidr "subnet"
66
- t.datetime "created_at"
67
- t.datetime "updated_at"
68
- end
69
-
70
- create_table :tags, force: true do |t|
71
- t.belongs_to :person
72
- end
73
-
74
- create_table :profile_ls, force: true do |t|
75
- t.belongs_to :person
76
- t.integer :likes
77
- end
78
-
79
- create_table :profile_rs, force: true do |t|
80
- t.belongs_to :person
81
- t.integer :dislikes
82
- end
83
- end
84
-
85
- puts "Database migrated"
86
- end
87
-
88
- task setup: :load_db_settings do
89
- unless ENV["DATABASE_URL"]
90
- Rake::Task["setup"].invoke
91
- Dotenv.load
92
- end
93
-
94
- Rake::Task["db:create"].invoke
95
- Rake::Task["db:migrate"].invoke
96
- end
97
- end
98
-
99
- # rubocop:enable Metrics/BlockLength
100
-
101
- def fetch_input(message)
102
- print message
103
- STDIN.gets.chomp
104
- end
@@ -1,33 +0,0 @@
1
-
2
- # frozen_string_literal: true
3
-
4
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "lib"))
5
-
6
- require "active_record_extended/version"
7
-
8
- Gem::Specification.new do |spec|
9
- spec.name = "active_record_extended"
10
- spec.version = ActiveRecordExtended::VERSION
11
- spec.authors = ["George Protacio-Karaszi", "Dan McClain", "Olivier El Mekki"]
12
- spec.email = ["georgekaraszi@gmail.com", "git@danmcclain.net", "olivier@el-mekki.com"]
13
-
14
- spec.summary = "Adds extended functionality to Activerecord Postgres implementation"
15
- spec.description = "Adds extended functionality to Activerecord Postgres implementation"
16
- spec.homepage = "https://github.com/georgekaraszi/ActiveRecordExtended"
17
- spec.license = "MIT"
18
-
19
- spec.files = `git ls-files`.split("\n")
20
- spec.test_files = `git ls-files -- spec/*`.split("\n")
21
- spec.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
22
- spec.require_paths = ["lib"]
23
-
24
- spec.add_dependency "activerecord", ">= 5.0", "< 6.0"
25
- spec.add_dependency "ar_outer_joins", "~> 0.2"
26
- spec.add_dependency "pg", ">= 0", "< 1.1"
27
-
28
- spec.add_development_dependency "bundler", "~> 1.16"
29
- spec.add_development_dependency "database_cleaner", "~> 1.6"
30
- spec.add_development_dependency "rake", "~> 10.0"
31
- spec.add_development_dependency "rspec", "~> 3.0"
32
- spec.add_development_dependency "simplecov", "~> 0.16"
33
- end
data/bin/console DELETED
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require "bundler/setup"
5
- require "active_record_extended"
6
-
7
- # You can add fixtures and/or initialization code here to make experimenting
8
- # with your gem easier. You can also use a different console, if you like.
9
-
10
- # (If you use this, don't forget to add pry to your Gemfile!)
11
- # require "pry"
12
- # Pry.start
13
-
14
- require "irb"
15
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- gemspec path: ".."
6
-
7
- gem "activerecord", "~> 5.0.0"
8
- gem "pg", "~> 0.18"
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- gemspec path: ".."
6
-
7
- gem "activerecord", "~> 5.1.0"
8
- gem "pg", "~> 0.18"
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- gemspec path: ".."
6
-
7
- gem "activerecord", ">= 5.2"
8
- gem "pg", "~> 0.18"
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- gemspec path: ".."
6
-
7
- gem "activerecord", "~> 5.2.0"
8
- gem "pg", "~> 0.18"