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

fix generators template bug #978

Merged
merged 2 commits into from
Jul 2, 2015
Merged

fix generators template bug #978

merged 2 commits into from
Jul 2, 2015

Conversation

regonn
Copy link

@regonn regonn commented Jun 30, 2015

My environment is

rails 4.2.3
active_model_serializers 0.10.0.rc2

When I executed this code

$ bin/rails g resource item name:string price:integer user:references

and generate this code

class ItemSerializer < ActiveModel::Serializer
  attributes :id, :name, :price
end
  attribute :user 

I think generator template has a bug, and I fixed it.

@joaomdmoura
Copy link
Member

@regonn hmm, this is strange. Indeed it seems that the test we have right now don't test the whole file, but only use assert_match.
Could you write a test to this? 😄

@bf4
Copy link
Member

bf4 commented Jul 1, 2015

@joaomdmoura Partly my bad for not adding one in my previous two revisions of the generator :(

@regonn
Copy link
Author

regonn commented Jul 1, 2015

@joaomdmoura I added assert_match test.
I couldn't find an example of file tail test at other gem repository. Do you have another idea?

@joaomdmoura
Copy link
Member

no worries @bf4 😄 you all have being doing an awesome work here!
@regonn I think this is the most straightforward way to test it too 😄
I'm cool with it, just ran the test against master it was indeed breaking.
I'm merging it.

joaomdmoura added a commit that referenced this pull request Jul 2, 2015
@joaomdmoura joaomdmoura merged commit 952d8ad into rails-api:master Jul 2, 2015
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

Successfully merging this pull request may close these issues.

None yet

3 participants