Uh oh!
There was an error while loading. Please reload this page.
AboutGem assignment submission. - #7
Conversation
There was a problem hiding this comment.
Nice use here to load the gem directly from github. You'll use this when you fork a repository.
jwo
commented
Mar 17, 2014
Great job! |
codeblahblah
commented
Mar 17, 2014
@jwo Awesome! On to the Eagle level. I'm not too sure where to start but On Monday, March 17, 2014, Jesse Wolgamott notifications@github.com wrote:
"When you are tired of being yourself then you can be ordinary." - dudu |
jwo
commented
Mar 17, 2014
Devise is a Rails engine (so has to be used in Rails), and it's extremely complicated. I have not used this, but it looks useful for sinatra and activerecord: https://github.com/janko-m/sinatra-activerecord |
codeblahblah
commented
Mar 18, 2014
@jwo I'm all over the place as far as implementing the Eagle level. |
jwo
commented
Mar 19, 2014
Adventure gem looks great. Other devs have used it as ActiveRecord, though it looks like you're using it as more just ruby classes. Either work. |
codeblahblah
commented
Mar 19, 2014
@jwo I'm trying to do the same...use it as ActiveRecord. How do I overcome this error? On 19 March 2014 19:57, Jesse Wolgamott notifications@github.com wrote:
"When you are tired of being yourself then you can be ordinary." - dudu |
jwo
commented
Mar 19, 2014
Why do you do this? https://github.com/drammopo/adventure/blob/master/lib/adventure.rb#L4 require“active_record"Jesse Wolgamott @ Comal Productions, Inc. On Wednesday, March 19, 2014 at 3:58 PM, drammopo wrote:
|
jwo
commented
Mar 19, 2014
Another possibility: You did not edit your gemspec, you edited your Gemfile on the gem itself. So, it will not install that when you use it. Nothing is loading ActiveRecord because you haven’t told it that it needed to be loaded. Jesse Wolgamott @ Comal Productions, Inc. On Wednesday, March 19, 2014 at 4:01 PM, Jesse Wolgamott wrote:
|
codeblahblah
commented
Mar 19, 2014
@jwo Remembered that you can load dependencies as: Still have the same error.... |
codeblahblah
commented
Mar 19, 2014
@jwo Changed page.rb to Gettting a "better" error in that the specs run....with the error ActiveRecord::ConnectionNotEstablished |
codeblahblah
commented
Mar 19, 2014
@jwo In Episode3, we have a db directory which uses db/migrate/...rb , seed.rb and setup.rb files to initialize the app. |
jwo
commented
Mar 19, 2014
With eagle assignments, there's no "should"..... You need to be 100% sure on the load order:
On Wed, Mar 19, 2014 at 4:56 PM, drammopo notifications@github.com
|
codeblahblah
commented
Mar 19, 2014
@jwo Do. Or do not. There is no try? |
jwo
commented
Mar 19, 2014
🤘 On Wed, Mar 19, 2014 at 5:15 PM, drammopo notifications@github.com
|
codeblahblah
commented
Apr 7, 2014
@jwo Been struggling with the Eagle level for sometime. I'd like to run the tasks below in order to bootstrap the gem within the Sinatra app....(but I think it impossible) Can I have custom tasks as above? |
jwo
commented
Apr 8, 2014
So let's say you wanted to have rakeadventure:migraterakeadventure:seedThis is possible! In here (https://github.com/drammopo/adventure/tree/master/lib) you need a "tasks" directory, with a You'll instruct your clients to See also: You'll see this is pretty much exactly what is done here https://github.com/janko-m/sinatra-activerecord |
codeblahblah
commented
Apr 8, 2014
@jwo Thanks for the clues. My latest version of the gem is up. At the moment everything seems to work...fine. |
jwo
commented
Apr 8, 2014
This is a model that is backed by a database moduleAdventureclassPage < ActiveRecord::BaseendendThis is a plain ruby class, without a database table behind it moduleAdventureclassBookendendIf you do not add your classes to a module, they exist in a global namespace. So, let's say you have an But, if you have |
codeblahblah
commented
Apr 8, 2014
@jwo Makes perfect sense. |
codeblahblah
commented
Apr 8, 2014
@jwo From :http://blog.smartlogicsolutions.com/2009/05/26/including-external-rake-files-in-your-projects-rakefile-keep-your-rake-tasks-organized/ Rake assumes the ‘require’d files end in .rb, so it won’t find your .rake files. You need to import rake files: This is fine for individual files, but I wanted to include all files that end in .rake in my tasks dir: …and there you go. |
codeblahblah
commented
Apr 8, 2014
@jwo Seems this is the way to go about it.. |
jwo
commented
Apr 8, 2014
Dir.glob('tasks/*.rake').each{ |r| importr}Perfect!
Yep. good choice. |
codeblahblah
commented
Apr 8, 2014
@jwo Sucker for punishment that I am...I kinda started but will stop while I'm ahead! |
@jwo Completed the Panda and Tiger level.
The app is hosted here: http://obscure-badlands-2253.herokuapp.com/