dtaniwaki / acts_as_hashids Goto Github PK
View Code? Open in Web Editor NEWUse Youtube-Like ID in ActiveRecord seamlessly.
License: MIT License
Use Youtube-Like ID in ActiveRecord seamlessly.
License: MIT License
@dtaniwaki thank you for this gem and getting in the latest updates for Ruby 3.0/3.1 and Rails 6.1/7.0. Any chance we can get a new version release?
My Gemfile
has the latest version pinned with the github repo and reference, but we ran into an issue yesterday with Heroku where it failed to resolve github.com
gems and blocked any releases. It has been subsequently fixed by Heroku, but it would be helpful if we had a version bump published on rubygems.org. Thank you!
So we can set one environment variable secret for all the models?
does this gem generate unique hashid ?
and how i can save this ids into database ?
Description:
Given class as below
Class Base < ActiveRecord::Base
self.abstract_class = true
acts_as_hashids length: 4
end
class CoreFoo < Base
has_many :core_bars
end
class CoreBar < Base
belongs_to :core_foo
end
In spec this will throw an error
# in spec - this will throw an error
let!(:foo1) { CoreFoo.create }
let(:bar3) { CoreBar.create core_foo: foo1 }
let(:bar4) { CoreBar.create core_foo: foo1 }
before do
bar3
bar4
end
context 'with normal id' do
it 'should behave like normal AR' do
expect(foo1.core_bars.find(bar3.id)).to eq bar3
end
end
Error
NameError:
undefined local variable or method `hashids' for #<ActiveRecord::Associations::CollectionProxy []>
Expected Output:
When using integer id or the real id, find
should run without first try to encode to hashid
and return the record
Ruby: 3.2.2
Rails: 7.1.3
act_as_hash_ids: 0.1.3
When relation have has_many
relation it will throw this error, suspecting this have to do with Ruby 3
Failure/Error: has_many :users
NoMethodError:
undefined method `arity' for {:extend=>[ActsAsHashids::Core::FinderMethods]}:Hash
If you navigate to a route using an invalid hash, instead of returning a rails application error, should just return a 404 error.
Hi, thanks for this gem! It looks like no activity for 2+ years. Any status update?
Also, I'm curious if PR #15 or similar for ruby 2.7+ support is planned. Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.