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

Add support for where_object and where_object_changes with JSON and JSONB columns #518

Closed

Conversation

mikeraimondi
Copy link
Contributor

No description provided.

@mikeraimondi
Copy link
Contributor Author

The tests pass for me locally. Not sure what's going on with Travis.

@@ -118,12 +139,12 @@ def primary_key_is_int?

# Returns whether the `object` column is using the `json` type supported by PostgreSQL
def object_col_is_json?
@object_col_is_json ||= [:json, :jsonb].include?(columns_hash['object'].type)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason we shouldn't cache / memoize these?

@batter
Copy link
Collaborator

batter commented Apr 15, 2015

Hmm.. I just upgraded to Postgres 9.4 on my local system and ran the test suite and saw the same errors that Travis is returning so I'll see if I can do some hacking to figure out what's up. Thanks for the pull request, let me know if you have any ideas regarding the invalid token errors.

batter added a commit that referenced this pull request May 7, 2015
@batter batter closed this in cff34a7 May 7, 2015
batter added a commit that referenced this pull request May 7, 2015
@batter batter added this to the 4.0.0 milestone May 7, 2015
@batter
Copy link
Collaborator

batter commented May 7, 2015

Thanks a lot for the pull request! This is super helpful. I was able to get all the tests to pass on Travis and even added some additional tests for good measure surrounding the column types.

It turns out that ActiveRecord 3.x doesn't support JSON column types for PostgreSQL, and JSONB column types are only supported on ActiveRecord 4.2+.

@mikeraimondi
Copy link
Contributor Author

Nice! Glad you got it to pass on Travis.

@gmhawash
Copy link

gmhawash commented Jul 6, 2015

Any plans on merging this PR into master?

@jaredbeck
Copy link
Member

Any plans on merging this PR into master?

The commits are already in master. See, e.g. a98d88c

GH doesn't make it easy to tell they're already in master, does it :)

@gmhawash
Copy link

gmhawash commented Jul 6, 2015

Thanks Jared, I did not bother to look in the actual file, and you're right, GH did not indicate that it was merged in

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.

4 participants