2. Editor Role 1 Step 1


#1

class User < ActiveRecord::Base
  has_secure_password
	def editor? 
  self.role == 'editor' 
end
end

This is my code for this exercise ^ I've taken a look at this topic on the same exercise and I have the same code (well, not the same white space, but that shouldn't matter in Ruby) but it doesn't work. For the sake of trying, I tested out the whitespace shown in that exercise and that didn't work either. I went over the previous exercise over again as well. Also, I don't get error messages. It just says that it's wrong, like so:

Am I supposed to be getting error messages? Is there something I should be doing differently?


#2

Hi Eli,

Could you please reupload your screenshot, as we can't see it right now.

Also,

white space, but that shouldn't matter in Ruby

That's true, but it does matter for you. Whitespace makes your code much easier to read and debug, so it's good to have proper whitespace regardless of the language you're writing code in.


#3

Here's the new screenshot:

And as for whitespace, that's a good point. Thanks for the tip :slight_smile:


#4

@elimadison2019 Your code looks about the same as mine, which passed :confused:

class User < ActiveRecord::Base
  has_secure_password
  
  def editor?
    self.role == 'editor'
  end
end

Since you're not getting any error messages, that suggests that maybe the problem is on their end, though. Could you try refreshing the page and/or switching browsers?


#5

i had same problem. At saturday advisors say's me they got issue on codecademy side. They report about this bug. Would be good to know about progress with this bug.


#6

Tried switching browsers and restarting and no luck :disappointed_relieved: Maybe just give it time? Thanks for trying.


#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.