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

auto_upgrade! NameError: no member 'limit' in struct #78

Open
tommarshall opened this issue Sep 14, 2017 · 2 comments
Open

auto_upgrade! NameError: no member 'limit' in struct #78

tommarshall opened this issue Sep 14, 2017 · 2 comments

Comments

@tommarshall
Copy link

Calling Model.auto_upgrade! for a second (or any subsequent time) raises a NameError after the initial run.

irb(main):001:0> Location.auto_upgrade!
NameError: no member 'limit' in struct
	from (irb):1

Model:

class Location < ApplicationRecord
  col :name,        as: :string, null: false
  col :description, as: :text
  timestamps

  validates :name, presence: true

  has_many :spaces
end

Full stack:

NameError: no member 'limit' in struct
Did you mean?  limit=
/usr/local/bundle/bundler/gems/mini_record-cc3edb544089/lib/mini_record/auto_schema.rb:253:in `[]'
/usr/local/bundle/bundler/gems/mini_record-cc3edb544089/lib/mini_record/auto_schema.rb:253:in `block in field_attr_changes'
/usr/local/bundle/bundler/gems/mini_record-cc3edb544089/lib/mini_record/auto_schema.rb:252:in `each'
/usr/local/bundle/bundler/gems/mini_record-cc3edb544089/lib/mini_record/auto_schema.rb:252:in `field_attr_changes'
/usr/local/bundle/bundler/gems/mini_record-cc3edb544089/lib/mini_record/auto_schema.rb:393:in `block in auto_upgrade!'
/usr/local/bundle/bundler/gems/mini_record-cc3edb544089/lib/mini_record/auto_schema.rb:391:in `each'
/usr/local/bundle/bundler/gems/mini_record-cc3edb544089/lib/mini_record/auto_schema.rb:391:in `auto_upgrade!'
/app/lib/tasks/mini_record.rake:10:in `block (3 levels) in <top (required)>'
/app/lib/tasks/mini_record.rake:4:in `each'
/app/lib/tasks/mini_record.rake:4:in `block (2 levels) in <top (required)>'
/usr/local/bundle/gems/rake-12.1.0/exe/rake:27:in `<top (required)>'

Versions:

rails: 5.1.4
mini_record: 0.5.0

@tommarshall
Copy link
Author

cc: @dan-watson

@tommarshall
Copy link
Author

Downgrading to 5.0.6 resolves the issue.

irb(main):001:0> Location.auto_upgrade!
=> {true=>{}, false=>{}}

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

1 participant