This file contains hidden or 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
package io.realm.example; | |
import io.realm.RealmObject; | |
public class Dog extends RealmObject { | |
private String name; | |
public String getName() { | |
return name; |
This file contains hidden or 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
package io.realm.example; | |
import io.realm.RealmObject; | |
public class Dog extends RealmObject { | |
private String name; | |
public String getName() { | |
return name; |
This file contains hidden or 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
package io.realm.example; | |
import io.realm.RealmObject; | |
public class Dog extends RealmObject { | |
private String name; | |
public String getName() { | |
return name; |
This file contains hidden or 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
def sidebar_link_to(resource, options = {}) | |
options[:action] ||= 'index' | |
return unless can? options[:action], resource | |
options[:title] ||= t("#{resource}.#{options[:action]}.title") | |
content_tag :li, class: 'menu-item' do | |
link_to url_for(action: options[:action], controller: resource), class: 'menu-link' do | |
content_tag(:i, nil, class: "icon-#{options[:icon]}") + | |
options[:title] |
This file contains hidden or 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
Starts working at 7am at Job A | |
Starts travelling at 8am from Job A | |
Starts working at 9am at Job B | |
Finished for the day at 3pm | |
| datetime | activity | job_id | duration | adjusted_dateimte | adjusted_duration | |
+----------+---------------+--------+ | |
7am work 1 1 9am 0 (9am - 8am) |
This file contains hidden or 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
precise64 :: /vagrant » rspec spec/controllers/api/beta/clocks_controller_spec.rb | |
Exception encountered: #<SyntaxError: /vagrant/app/controllers/api/beta/clocks_controller.rb:56: syntax error, unexpected '(', expecting keyword_end | |
render :json => @clock(:message => message) | |
^> | |
backtrace: | |
/home/vagrant/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require' | |
/home/vagrant/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `block in require' | |
/home/vagrant/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:236:in `load_dependency' | |
/home/vagrant/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in `require' | |
/home/vagrant/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:359:i |
This file contains hidden or 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
def calculate_cached_attributes | |
# TODO OPTIMIZE | |
clocks.sort_by!(&:datetime) | |
self.started_at = clocks.first.datetime | |
# assign finished_at if shift is finished and check that there isn't one finish clock | |
if clocks.last.activity == :finish && clocks.first != clocks.last | |
self.finished_at = clocks.last.datetime | |
else |
This file contains hidden or 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
# routes | |
namespace :api, path: '/' do | |
constraints :subdomain => 'api' do | |
get 'users' => 'users#index' | |
end | |
end | |
# url_for | |
link_to "Api User", api_users_path |
This file contains hidden or 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
public class Job extends Model { | |
private static final String ROUTE = "jobs"; | |
public Job(Activity activity) { | |
super(ROUTE, activity); | |
} | |
} |
This file contains hidden or 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
public class Job extends Model { | |
private static final String ROUTE = "jobs"; | |
public Job(Activity activity) { | |
super(ROUTE, activity); | |
} | |
} |
NewerOlder