-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lot of testing and some improvements
- Loading branch information
1 parent
02a6765
commit d0f4fba
Showing
10 changed files
with
358 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
Gem::Specification.new do |s| | ||
s.name = "statisfy" | ||
s.version = "0.0.1" | ||
s.required_ruby_version = ">= 3.2.0" | ||
s.date = "2023-12-07" | ||
s.summary = "A performant and flexible counter solution" | ||
s.description = "A performant and flexible counter solution that allows to make statistics on your models" | ||
|
@@ -11,4 +12,11 @@ Gem::Specification.new do |s| | |
s.email = "[email protected]" | ||
s.files = Dir["lib/**/*"] | ||
s.license = "MIT" | ||
s.add_development_dependency "activerecord", "~> 7.0.4.3" | ||
s.add_development_dependency "activesupport", "~> 7.0.4.3" | ||
s.add_development_dependency "redis", "~> 4.8.1" | ||
s.add_development_dependency "redis-client", "~> 0.17.0" | ||
s.add_development_dependency "rubocop", "~> 1.49.0" | ||
s.add_development_dependency "sqlite3", "~> 1.6.9" | ||
s.add_development_dependency "pry", "~> 0.14.1" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
require "active_record" | ||
|
||
class Organisation < ActiveRecord::Base | ||
has_many :users | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require "active_record" | ||
require_relative "organisation" | ||
|
||
class User < ActiveRecord::Base | ||
belongs_to :organisation | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require "active_record" | ||
require "redis" | ||
require "statisfy" | ||
|
||
ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:" | ||
|
||
ActiveRecord::Base.connection.create_table :users, force: true do |t| | ||
t.string(:name) | ||
t.integer(:organisation_id) | ||
t.integer(:salary) | ||
t.timestamps | ||
end | ||
|
||
ActiveRecord::Base.connection.create_table :organisations, force: true do |t| | ||
t.string(:name) | ||
t.timestamps | ||
end | ||
|
||
Statisfy.configure do |config| | ||
config.redis_client = Redis.new | ||
end |
Oops, something went wrong.