Closed eqbal closed 9 years ago
I've just made some changes so it can be loaded without Rails, and it'll make sure the models are loaded automatically as well. The one catch is that you won't get the automatic migrations added in. I'm not yet sure if there's an elegant way to do this though…
If you have a moment and can test this in your gem before I push a new release, that'd be great:
gem 'gutentag',
:git => 'git://github.com/pat/gutentag.git',
:branch => 'master',
:ref => 'b4a26561dd'
Thanks for your swift response mate, This is awesome.
I have to say tho that I had to create my own implementation for tags.
Not sure if your changes working fine for me. What I did is I added the new
gem to my Gemfile and then required that gem at the model and added
has_many_tags
burt got this error:
/Users/info/.rvm/gems/ruby-2.2.2/bundler/gems/gutentag-b4a26561ddbb/app/models/gutentag/tag.rb:7:in `class:Tag': uninitialized constant Gutentag::Tag::Rails (NameError)
On Thu, Aug 27, 2015 at 5:26 PM, Pat Allan notifications@github.com wrote:
I've just made some changes so it can be loaded without Rails, and it'll make sure the models are loaded automatically as well. The one catch is that you won't get the automatic migrations added in. I'm not yet sure if there's an elegant way to do this though…
If you have a moment and can test this in your gem before I push a new release, that'd be great:
gem 'gutentag', :git => 'git://github.com/pat/gutentag.git', :branch => 'master', :ref => 'b4a26561dd'
— Reply to this email directly or view it on GitHub https://github.com/pat/gutentag/issues/16#issuecomment-135451962.
Just checked your modifications and I think this should work fine tho, I mean for:
+if defined?(Rails::Engine)
Aw checking why having some conflict with the name space and I'll keep u updated.
Cheers
On Thu, Aug 27, 2015 at 5:58 PM, Eqbal Eki eqbal.quran@gmail.com wrote:
Thanks for your swift response mate, This is awesome.
I have to say tho that I had to create my own implementation for tags.
Not sure if your changes working fine for me. What I did is I added the new gem to my Gemfile and then required that gem at the model and added
has_many_tags
burt got this error:/Users/info/.rvm/gems/ruby-2.2.2/bundler/gems/gutentag-b4a26561ddbb/app/models/gutentag/tag.rb:7:in `class:Tag': uninitialized constant Gutentag::Tag::Rails (NameError)
On Thu, Aug 27, 2015 at 5:26 PM, Pat Allan notifications@github.com wrote:
I've just made some changes so it can be loaded without Rails, and it'll make sure the models are loaded automatically as well. The one catch is that you won't get the automatic migrations added in. I'm not yet sure if there's an elegant way to do this though…
If you have a moment and can test this in your gem before I push a new release, that'd be great:
gem 'gutentag', :git => 'git://github.com/pat/gutentag.git', :branch => 'master', :ref => 'b4a26561dd'
— Reply to this email directly or view it on GitHub https://github.com/pat/gutentag/issues/16#issuecomment-135451962.
Ah, I had a reference to the Rails
constant in Gutentag::Tag
- fixed in 1e6f9ad0a9f69c1122314dd5ede283a9b2f7dfc6.
Do I need to change the ref number or anything ?
As I'm getting this error for now:
/Users/info/.rvm/gems/ruby-2.2.2/bundler/gems/gutentag-b4a26561ddbb/app/models/gutentag/tag.rb:7:in `class:Tag': uninitialized constant Gutentag::Tag::Rails (NameError)
On Thu, Aug 27, 2015 at 6:21 PM, Pat Allan notifications@github.com wrote:
Ah, I had a reference to the Rails constant in Gutentag::Tag - fixed in 1e6f9ad https://github.com/pat/gutentag/commit/1e6f9ad0a9f69c1122314dd5ede283a9b2f7dfc6 .
— Reply to this email directly or view it on GitHub https://github.com/pat/gutentag/issues/16#issuecomment-135467000.
Oh my bad, changed to 1e6f9ad
and now working like charm.
Thanks mate
Eki
On Thu, Aug 27, 2015 at 7:03 PM, Eqbal Eki eqbal.quran@gmail.com wrote:
Do I need to change the ref number or anything ?
As I'm getting this error for now:
/Users/info/.rvm/gems/ruby-2.2.2/bundler/gems/gutentag-b4a26561ddbb/app/models/gutentag/tag.rb:7:in `class:Tag': uninitialized constant Gutentag::Tag::Rails (NameError)
On Thu, Aug 27, 2015 at 6:21 PM, Pat Allan notifications@github.com wrote:
Ah, I had a reference to the Rails constant in Gutentag::Tag - fixed in 1e6f9ad https://github.com/pat/gutentag/commit/1e6f9ad0a9f69c1122314dd5ede283a9b2f7dfc6 .
— Reply to this email directly or view it on GitHub https://github.com/pat/gutentag/issues/16#issuecomment-135467000.
Just released 0.7.0 with these changes :)
Awesome.
Cheers mate.
On Thursday, August 27, 2015, Pat Allan notifications@github.com wrote:
Just released 0.7.0 with these changes :)
— Reply to this email directly or view it on GitHub https://github.com/pat/gutentag/issues/16#issuecomment-135541685.
Thanks for this awesome gem. Anyway, I'm trying to gemify all the models and use it outside Rails (Grape) and now when I include the gem it doesn't seems to be working?
I added the gem to my models.gemspec like spec.add_dependency "gutentag","~> 0.6.0".
Now when I try to use has_many_tags in my model I get:
When I try to require the gem in the model I get this error:
Any help would be appreciated.