Comments (8)
@tagliala Sent me a PR, I merged and released the fix as 0.14.3! I've also marked you as a contributor @tagliala if you can help keep RABL alive and well in whatever capacity you can, I appreciate it. That goes for anyone else reading this thread too.
Sorry that I haven't been able to maintain this much in the last few years, it is genuinely humbling that people still use this library, and sorry it isn't even better! I do still use this library myself extensively, I just have it locked to old versions of Sinatra and haven't needed any new features in a long time.
from rabl.
I’ll look into this soon, sorry to hear about that. Once I can confirm, I’ll yank 0.14.1 until this is resolved
from rabl.
Confirm this issue.
Problem is in commit: 4cf2c66
exactly this change: 4cf2c66#diff-5a71730235e40573daff6c167a927d5dR85-R89
because on Rails 4 an active record relation responds to both :map
and :each
but it is not an enumerable
[2] pry(main)> Document.all.respond_to?(:map)
=> true
[3] pry(main)> Document.all.respond_to?(:each)
=> true
[4] pry(main)> Document.all.is_a?(Enumerable)
=> false
Hope it helps
from rabl.
Sorry to hear about this, I am unfortunately no longer able to actively maintain RABL (which I first created many years ago now) as you probably gathered, though I still happily use an old version on several of my own apps. It's honestly amazing to me that it's still used as much as it is!
If anyone can point me to a PR, and a recommended course of action, I'd be more than happy to push a 0.14.2 to resolve this
from rabl.
Thanks! I created a sample app to reproduce the issue: https://github.com/swiknaba/rabl_0140
from rabl.
Same problem here.
We're presenting an ActiveRecord::Relation
object in our templates:
# controller
@tags = Tag.where(...)
# template
object @tags
attributes :id, :name, :position
The workaround for this is converting the collection to an array (but that's obviously bad for performance):
object @tags.to_a
from rabl.
Yeah, I just bitten by this, locking the gem to 0.14.0 until either it's fixed or, presumably, I move to Rails > 4.2 and this is no longer an issue
from rabl.
@nesquena apologies are not necessary. Thank you for all these years, I've been using rabl since forever 🙏🏼
from rabl.
Related Issues (20)
- Drop riot? Unmaintained, broken on Ruby 2.5. HOT 2
- How to use rabl with swagger? HOT 2
- Tagging a new version, or use master branch? HOT 1
- Unable to properly render json for an simple array of objects HOT 1
- How do I render free form metadata HOT 1
- Migrating to Rails 5 - Rabl returning Active Record object
- Rspec renders rabl as string instead of json
- Not able to get the rendered result in Rails console HOT 1
- Rabl output values as keys
- Rabl partial lookup based on requested api namespace
- Child removes node from response when the provided object is an empty array HOT 2
- Rabl not renders collection properly HOT 4
- Is nested map valid in RABL?
- N+1 issues HOT 1
- some problems to install rable on windows HOT 2
- Avoid playing with `Oj` shared `default_options` HOT 2
- rabl tests failing with rr 3.x and Ruby 3 HOT 12
- Rails 7 compatibility HOT 1
- access controller instance variables in representers
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rabl.