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

Incorrect extraneous quoting when trying to update/insert #37

Open
avishai opened this issue Oct 15, 2013 · 4 comments
Open

Incorrect extraneous quoting when trying to update/insert #37

avishai opened this issue Oct 15, 2013 · 4 comments

Comments

@avishai
Copy link

avishai commented Oct 15, 2013

I've been using this gem for over a year, and I just ran bundle update and for some reason now it keeps raising
unit_amenities must be an Array or have a valid array value (''{"balcony","dishwasher","hardwood floors","home office","tile floors"}'')

params[:unit_amenities] are submitted as follows:

"unit_amenities"=>["balcony",
 "dishwasher",
 "hardwood floors",
 "home office",
 "tile floors"],

In the Rails console, this is what I get:

1.9.3p429 :007 > a.unit_amenities
 => ["dishwasher", "balcony"] 
1.9.3p429 :008 > a.unit_amenities << "hardwood floors"
 => ["dishwasher", "balcony", "hardwood floors"] 
1.9.3p429 :009 > a.save
   (0.2ms)  BEGIN
   (0.9ms)  UPDATE "listings" SET "description" = 'Little Italy was once a lively home for the most of the Italian population in New York. state-of-the-art laundry facilities, [...]', "updated_at" = '2013-10-15 18:19:50.153309' WHERE "listings"."id" = 1032369
   (23.7ms)  COMMIT
 => true 
1.9.3p429 :010 > a.unit_amenities
 => ["dishwasher", "balcony"] # is appears that the updates are just completely dropped from the update, also.
vjt added a commit to ifad/activerecord-postgres-array that referenced this issue Nov 27, 2013
* leonardvandriel/master:
  Fix incorrect extraneous quoting (issues tlconnor#34 and tlconnor#37)
@joevandyk
Copy link

@tlconnor could this get merged?

@pokonski
Copy link

Because of this bug, the gem is worthless.

@leovandriel
Copy link

You can downgrade to version 0.0.9, that should fix the bug. You can can safely stay at this version, since this gem is not maintained anymore. Alternatively, try a fork: #38

@pokonski
Copy link

@leonardvandriel thanks. Just did that and 0.0.9 works fine :)

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

4 participants