Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method `inheritable_array' for #<Representable::Config> #66

Closed
Nerian opened this issue Feb 27, 2013 · 7 comments
Closed

undefined method `inheritable_array' for #<Representable::Config> #66

Nerian opened this issue Feb 27, 2013 · 7 comments

Comments

@Nerian
Copy link

Nerian commented Feb 27, 2013

I updated Roar from 0.11.9 to 0.11.11 and I get the following error:

undefined method `inheritable_array' for #<Representable::Config:0x007fe5c4f52a60>
# ./app/controllers/api/v1/discussions_controller.rb:6:in `index'

Controller

def index
    discussions = current_eclass.discussions.paginate(page: params[:page], per_page: params[:per_page]).all
    respond_with discussions
  end

Representer

module Api::V1::DiscussionsRepresenter
  include Roar::Representer::JSON
  include Api::V1::PaginationRepresenter

  collection :items, :extend => Api::V1::DiscussionRepresenter, :class => Discussion

  def items
    collect
  end

end

PaginationRepresenter

module Api::V1::PaginationRepresenter
  include Roar::Representer::JSON
  include Roar::Representer::Feature::Hypermedia

  property :total_entries
  property :per_page
  property :current_page

  def items
    self
  end

end

It was correctly working, until I updated. Is there anything I need to change in order to be compatible with the new version?

@Nerian
Copy link
Author

Nerian commented Feb 27, 2013

If I remove include Roar::Representer::Feature::Hypermedia from the pagination representer everything works right.

@apotonick
Copy link
Member

Dang, that looks like a bug.

On Thu, Feb 28, 2013 at 2:11 AM, Gonzalo Rodríguez-Baltanás Díaz <
[email protected]> wrote:

If I remove include Roar::Representer::Feature::Hypermedia from the
pagination representer everything works right.


Reply to this email directly or view it on GitHubhttps://github.com//issues/66#issuecomment-14178479
.

@apotonick
Copy link
Member

I just released 0.11.12 which should fix this - can you give it a try, plehease?

@Nerian
Copy link
Author

Nerian commented Feb 28, 2013

Working like a charm, thanks

@Nerian Nerian closed this as completed Feb 28, 2013
@Nerian
Copy link
Author

Nerian commented Apr 29, 2013

Mmm, This bug is active again in representable (1.4.1), roar-rails (0.0.14), roar (0.11.14)

@Nerian Nerian reopened this Apr 29, 2013
@apotonick
Copy link
Member

@Nerian can you check if 0.11.15 fixes this? Actually the fix I commited earlier this year didn't fix the issue :-)

@Nerian
Copy link
Author

Nerian commented Apr 30, 2013

Fixed, Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants