Skip to content

Code was not adding foreign_type constraint#5

Merged
doliveirakn merged 1 commit intoclio:masterfrom
tispratik:master
Feb 25, 2014
Merged

Code was not adding foreign_type constraint#5
doliveirakn merged 1 commit intoclio:masterfrom
tispratik:master

Conversation

@tispratik
Copy link
Copy Markdown
Contributor

When we already had some constraints on the relation definition.

Ex, below case did not work:
has_many :constraints, as: :restricted_object, integer_type: true,
:conditions => { :is_deleted => false }

A workaround prior to this commit was to use the reverse mapping:
has_many :constraints, as: :restricted_object, integer_type: true,
:conditions => { :is_deleted => false, restricted_object_type: RESTRICTED_OBJECT_MAP_REVERSE[self.to_s] }

When we already had some constraints on the relation definition.

Ex, below case did not work:
  has_many :constraints, as: :restricted_object, integer_type: true,
           :conditions => { :is_deleted => false }

A workaround prior to this commit was to use the reverse mapping:
  has_many :constraints, as: :restricted_object, integer_type: true,
           :conditions => { :is_deleted => false, restricted_object_type: RESTRICTED_OBJECT_MAP_REVERSE[self.to_s] }
@doliveirakn
Copy link
Copy Markdown
Contributor

@tispratik Thanks for the pull request for this. I will merge this in and release a new version of the gem at some point soon.

@tispratik
Copy link
Copy Markdown
Contributor Author

Awesome thanks!

On Fri, Feb 21, 2014 at 11:56 AM, doliveirakn notifications@github.comwrote:

@tispratik https://github.com/tispratik Thanks for the pull request for
this. I will merge this in and release a new version of the gem at some
point soon.

Reply to this email directly or view it on GitHubhttps://github.com//pull/5#issuecomment-35767126
.

doliveirakn pushed a commit that referenced this pull request Feb 25, 2014
Code was not adding foreign_type constraint
@doliveirakn doliveirakn merged commit fe79527 into clio:master Feb 25, 2014
@doliveirakn
Copy link
Copy Markdown
Contributor

This has been merged. I have released a new point release for this change.
Version 1.0.2

@tispratik
Copy link
Copy Markdown
Contributor Author

Awesome! Thanks!

On Tue, Feb 25, 2014 at 3:16 PM, doliveirakn notifications@github.comwrote:

This has been merged. I have released a new point release for this change.
Version 1.0.2

Reply to this email directly or view it on GitHubhttps://github.com//pull/5#issuecomment-36071348
.

@tispratik
Copy link
Copy Markdown
Contributor Author

You will probably need to bump up the version here
https://github.com/doliveirakn/polymorphic_integer_type/blob/master/lib/polymorphic_integer_type/version.rb

On Tue, Feb 25, 2014 at 3:16 PM, pratik khadloya tispratik@gmail.comwrote:

Awesome! Thanks!

On Tue, Feb 25, 2014 at 3:16 PM, doliveirakn notifications@github.comwrote:

This has been merged. I have released a new point release for this
change.
Version 1.0.2

Reply to this email directly or view it on GitHubhttps://github.com//pull/5#issuecomment-36071348
.

@doliveirakn
Copy link
Copy Markdown
Contributor

haha, I did, It was just wasn't pushed up yet.

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.

2 participants