This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ExampleController | |
include OrderingHelpers | |
def index | |
@clients = Clients.order(sanitized_ordering).where(user_id: current_user.id) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/rails/apps/dcid $ rails c --sandbox | |
Loading development environment in sandbox (Rails 4.0.2) | |
Any modifications you make will be rolled back on exit | |
irb(main):001:0> user = User.new(name: "", email: "mhartl@example.com") | |
=> #<User id: nil, name: nil, email: nil, citizen_number: nil, created_at: nil, updated_at: nil, password_digest: nil> | |
irb(main):002:0> user.email | |
=> "mhartl@example.com" | |
irb(main):003:0> user.name | |
=> "" | |
irb(main):004:0> user.name="Bob" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fresh app results: | |
dcid_2 $ rails c | |
Loading development environment (Rails 4.0.2) | |
irb(main):001:0> user = User.new(name: "", email: "mhartl@example.com") | |
=> #<User id: nil, name: "", email: "mhartl@example.com", citizen_number: nil, password: nil, created_at: nil, updated_at: nil> | |
irb(main):002:0> user.valid? | |
=> true | |
irb(main):003:0> user.name | |
=> "" | |
irb(main):004:0> user.name="Bob" |