Skip to content

Ruby 2.4.1 support #273

@pavanprakash21

Description

@pavanprakash21

I was testing the gem with a fresh Rails 5.1.0rc1 app. Whenever I try to save a model, it just rolls back and exits me out of console without any indication.

This didn't happen in the beta release of the rails though.

# frozen_string_literal: true

class Audience
  belongs_to :client
  extend Enumerize

  enumerize :type, in: %i[T1 T2 T3]
end
[1] pry(main)> Audience.create!(name: 'Some Audience', start_age: 18, end_age: 90, visitor_type: 'T2', min_spend_value: 150, client_id: 1)
  Client Load (1.4ms)  SELECT  "clients".* FROM "clients" ORDER BY "clients"."id" ASC LIMIT $1  [["LIMIT", 1]]
   (0.2ms)  BEGIN
  SQL (3.5ms)  INSERT INTO "audiences" ("name", "visitor_type", "start_age", "end_age", "min_spend_value", "client_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id"  [["name", "Fourth Audience"], ["visitor_type", "T2"], ["start_age", 18], ["end_age", 90], ["min_spend_value", 150], ["client_id", 1], ["created_at", "2017-04-06 06:16:12.072160"], ["updated_at", "2017-04-06 06:16:12.072160"]]
   (0.3ms)  ROLLBACK

Has it anything to do with the magic frozen string literal comment?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions