Doing things the right way, as per ActiveRecord #19

wants to merge 4 commits into


None yet

4 participants


No description provided.

unknown and others added some commits Apr 11, 2013
unknown Copying over a few methods that are defined on AR::AssociationReflect…

Absence of these on EnumerationReflection causes ransack_ui to barf.
unknown I blame Mark, he told me it shold be false! :-b 82093ff
@hubrix hubrix comment out signing key
it seems broken

Errno::ENOENT: No such file or directory - gem-private_key.pem
An error occurred while installing power_enum (1.3.0), and Bundler cannot continue.
Make sure that `gem install power_enum -v '1.3.0'` succeeds before bundling.
@albertosaurus albertosaurus commented on the diff Apr 12, 2013
@@ -38,7 +38,7 @@ do |s|
s.homepage = ""
s.require_paths = ["lib"]
s.rubygems_version = "1.8.25"
- s.signing_key = "gem-private_key.pem"
+ #s.signing_key = "gem-private_key.pem"
albertosaurus Apr 12, 2013

Please don't do that.

  1. This gem is signed with my private key when I build it. If you're going to go through the trouble of trying to install it locally, generate a set of signing keys. See this:
  2. For better or worse, I use jeweler to develop the gem. The gemspec is generated by running rake gemspec. Any changes made to the gemspec get overwritten.
albertosaurus Apr 12, 2013

I have updated the README to better explain how setup PowerEnum in high security mode.

@albertosaurus albertosaurus commented on the diff Apr 12, 2013
+ alias :source_macro :macro
albertosaurus Apr 12, 2013

This line of code breaks four unit tests. The source_macro for PowerEnum is defined as :belongs_to. As mentioned in the RDoc, it's necessary to make joins work.

@albertosaurus albertosaurus commented on the diff Apr 12, 2013
def belongs_to?
- false
+ macro == :belongs_to
albertosaurus Apr 12, 2013

Not going to work.

albertosaurus Apr 12, 2013

I think you're better off explicitly defining macro. Something like

def macro

Having said that, I don't know off the top of my head what the second-order implications of that are going to be.

@adymo adymo Add PowerEnum::Reflection::EnumerationReflection::polymorphic?() func…

that just returns false for power enum reflections.

This is required (at least in Rails4) to do queries like
  where( enum: Enum[value] )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment